Bookmarklet Parse URL - Take The Current URL Of The Page And Open A New Window With A URL Based On The Current Page?
Mar 16, 2009
I'm trying to create two bookmarklets:
1. Take the current URL of the page and open a new window with a URL based on the current page. Some examples (I use "->" to mean "this URL turns into that URL"):I plan to use these bookmarklets in sequence, first pressing 1 to log into the CMS, then pressing 2 to edit the current page.
Basically I want some of the links in my page to open in new tabs (I'm using Firefox) or windows if the user has their options configured that way. And I want my page to remain intact as it involves some AJAX and takes a while to load.
But ...and this seems to be a big "but"... I don't want the focus to move away from the page I'm on. So techniques such as <a target="_blank"or <a onclick="window.open(...)"aren't working for this requirement. I even tried using a separate function and attempting to return to the original window straight after using the following function: Code:
My question if it's possibly to dynamical open (without hardcode URL)the same page (current page) in a dialog? I need to have a link on every every page in a site (the link lives into a template) and I need to open this page again in a dialog box with the same content.
As you can see this code will open up a new window. I can't seem to find the code to make it appear in the same window. As in I click on the link "ABOUT US" and the new page loads on the current window. Code: <div style = "cursor:pointer;hand" onclick = "window.open('testdocaboutus.html')" class = "txt-1">ABOUT US</div>
I am looking through the code on a web page and it has the following link in the script tag within the header: Code: if (parent.window.opener) parent.window.opener.location='[URL]';
My assumption, and research on the internet would suggest that it is redirecting the user to Google, but I am a bit confused by the 'parent window' and wanted to know a few things, such as: - Would the current page be redirected, or would a new window open? - If the page was triggered for a second time, within seconds of the first time, would the redirect still work? If my understanding of the code is correct, I'm confused as to why it is on this page, as the page contains information, yet is redirecting the user to another page on load.
I have 30 or 40 different (going to different websites) links on many pages on my website, that I when clicked I need opening under the current window. (Pop-under) - but obviously needs to be done safely (no risk of being pop-up blocked??)So rather than just a target="_blank" - it would be something slightly more complicated, doing a bit of research perhaps the .blur method would help (Though really I have no idea)I'm using the jQuery library for other elements on the site, so jQuery would be ideal if there is a solution for this?If you click on "get code and open site" (Green button) - you'll see it opens up the website under the current window - which is exactly what I want to achieve (It also uses .toggle to switch divs (but i've done that part - just need help with pop-unders
My requirement is, I have multiple pages in tab format. If i am on first page in edit mode and change any control's value and without saving information i click on other tab that particular time a popup should appear showing validation message say "you are moving without save and it will loos all changes either click ok to loose the changes and move to other page or click cancel to remain on the current page."I tried using var isDirty = false; var msg = 'This page has unsaved changes.Click OK to abandon the changes and leave the page.Click Cancel to stay on the page so that you can save your changes.';
Based on the lack of responses to the last hole (which I am attributing to one of the following:
a. The hole being too difficult,
b. It being overly time consuming, or
c. People not wanting to do it)
I have decided to take a step back for this hole.
This function should either take a file name/ path to file or a full URL as a parameter. If it is a filename/ path the function should include the file from the base URL of the current site (such as [url]). If it is a full URL just include it.
Make sure you don't allow files to be included multiple times, we don't want that!
There is many examples of PageLoader's etc. in the web, but I can't find a script like facebook (and many other sites) uses. When a link is cliked -> user stays at current page and get's "Page loading" etc. notice until the next page is fully downloaded.In other words; When I click a link (Internet Explorer), I get first "a white page" until next page show's ..I want, that the page does not go white at all, but current page show's until the next page is fully downloaded.
I have a button in my site which when clicked, will set the current page to be the home page for the user. I use the following code:
var hiddenLink = document.getElementById('dummyLink'); hiddenLink.style.behavior='url(#default#homepage)' hiddenLink.setHomePage('http://www.123.com'); somewhere in my <body>, I have the following link definition:
<a href="#" id="'dummyLink'" style="display:none"></a> Now, this solution works fine for IE But I need to have a working solution for Firefox and Opera too. Does anyone know how to solve this in these 2 browers?
I've got 2 pages: a current events page and a past events page the current events page loads fine as there is only about 10 events the past events page takes about 30 seconds to load and will crash if u click your mouse in the loading time.
The pages are near identical the only difference is the query that selects the events (> versus <)
The page loads immediately without:
But when i put it back in the above happens. I'm using jQuery.roundedcorners.
I wanna scroll the page to a specific location at the bottom. I can get the position of the destination, but how can I know where I am on the page? I need to scroll the page from the current location to the destination slowly not at once, is that possible?
Using the DOM the non-standard but widely implemented innerHTML extension, the following would be sufficient to modify the content of any element that can have content:
« <div id="anID">Some Content</div» with script of « document.getElementById("anID").innerHTML= "Some <em>new</emContent"; »
Where "anID" is the (unique on the HTML page) ID attribute value of the element to modify.
The script below adds support for « document.all » capable browsers. Support for NN4 is also possible, but certain issues mean that it is not listed here. Using the example above, the call would be written: