Which is the better option to use when dynamically loading a page?
document.location.href = "newpage.html"
or
document.URL = "newpage.html"
My book says that Netscape depreciated document.location.href in favour of document.URL, but yahoo are using document.location.href. Also, is there a good online reference (up-to-date) of the DOM which includes stuff like this?
Im currently creating a Table with 2 frames (table in top, last row clicked in bottom)
<html> <frameset rows = "60%, 40%"> <frame src = "table_driver.php" name = "A" id = "FRAME1"> <frame src = "bottom_row.php" name = "B" id = "FRAME2"> </frameset> </html>
In bottom_row.php I have one object, a [obj = new TableData()]. onClick of a row in FRAME1, obj is initialized to what was clicked and the row is changed.
anyways currently I have it working but want it such that it can work with multiple frames, with a location parameter.
I have been trying to get the code below working for 9 hours now. Finally, I decided to test the same code on another sever, and it works fine! I have no idea why the same code would work on one server, but not another.
The code is self-explanatory, I created a button that when clicked will navigate the user to a link (#hit1).
Code: <script type="text/javascript" language="javascript"> function firstHit(){ document.location="#hit1";
The code below will enter the function when enter key is pressed, and will activate the alerts but will not send to the new page using document.location
the onclick calls the function and sends to the new page?
<script language="javascript"> var ZIPS ="07071"; var ZIPS2 ="07960"; var zipArray = ZIPS.split("/");
I need to get the domain of the page (mydomain.com) There seems to be 2 variables to get this info. document.domain & window.location.host - Both are set in FF & IE. So whats the difference between these ?
In searching answers to my quest, I have been looking for a method using document.write to display the thumbnails in one division while showing text about the thumbs in another division.
All I've seen so far is that document.write('does this') and that's it. Nobody expands on this and explains what else you can do with it. It's like they're more interested in showing you the ads than the information you need.
Code: <a name="loc"></a> <a href="#loc" onClick="document.location.href='#loc' document.location.reload(false);return false">Click here to go to your location</a>
When you click onto the link you should go to the page location marked by the anchor tag "loc", however, upon clicking you go to the top of the page and never redirected to the exact spot where your anchor tag is located. Why is that? I'm using IE6 (per requirement) as my platform.
I'm trying to create a player stats page, for my gaming server. I spoke to a guy who knows a little about javascript, and he told me there's a way to use document.location.href to direct to a custom page URL.
For example, if I search for a name, and the results are displayed. I want to click the players username, and be directed to. [url] without the "username.html" actually existing.
I heard it's possible, and it would save me a lot of time because I don't want to have 20,000+ individual pages, one for each username.
I am writing a modification to Invision Power Board that makes replying to post via Ajax.
The "Submit" button is being overrun by Prototype's observe function. When the custom function is executed, I run Event.stop(e) to prevent the actual form from being submitted and reload the page.
I have developed and tested on Safari but users began to report bugs in IE, after investigation I discovered that the line
Code:
Is making IE execute all the code after it, and then execute its own onclick() function as if Event.stop(e) was not there. Commenting this line fixes the problem, the page is not reloaded, but this line is vital to the code.
So why do I need to set the anchor? To support the back button function after a user makes an ajax reply, pressing Back should hide the new content, and pressing Forward should make it visible. (e.g. every time the anchor is changed) This all works nicely. But not in IE.
This only happens the first time the page is visited ever, or clearing cache and visiting it again. Reloading the page fixes the problem but this is not normal behavior and users shouldn't have to reload to use the Ajax fast reply...
I have some code that changes a PDF file in another frame using:
parent.frame.document.location.href = "PDF File"
This code works fine the first time it is called. But if a PDF file is in that frame and the code is called again IE gives me an error:
"no such interface supported"
I have used this code for the past 5 years and it has worked fine with Adobe Acrobat 4-6 it is only 7 that started to cause me grief. It is only IE that has this problem, Netscape seems to work fine.
I have checked the web and talked to Adobe and have yet to find a solution.
Is there a difference between right clicking an iframe and reloading post reponse vs. using javascript to reload the frame? So far, the javascript route hasn't worked for me. [some context] I am writing a little bookmarklet to help me with the online registrations at my school. Here is the setup.
Load up a page on the domain. Remove all body elements. Insert an iframe. Set iframe to page for class roster search. (in iframe on school search page) Select class search options, POST the form data, and view results in frame. *This works perfectly, but I need to have it refresh results every minute or so. When I use frame.contentDocument.location.reload(true); the frame loses the post data or something and the page is broken. BUT when I just right click on the frame and select "reload frame" it works perfectly. What is the difference between rightclicking the frame and refreshing it like that vs. using javascript to reload the frame?
I have a client that has ads on her website that really slow down the site. These ads are called by an off site javascript file and I want to use a jQuery(document).ready or similar method to call these files after all of the site content has loaded. But these files contain document.write functions to add more javascript files. Since I want to load the files after everything else has loaded, this in turn makes the page blank and then loads the ad. Is there a way to position where document.write will write to?
Danged if I can find the thread, but I swear I saw a $.url() reference in here a day or two ago. It was beingutilized for parsing out the window.location or window.location.search parameters. I made a mental note because that was something I would be needing to do.
Now I can't find it, either because the search isn't finding it or I was dreaming about this function existing.
I rummaged about the API docs and didn't find it there either. Is it something provided by one of the plugins and not a function native to jQuery?
have this script to add a textbox at runtime. I wanted to limit the number of textboxes the user could throw out so i added a counter and limit to the script.
Here's the code
var counter = 1; var limit = 3; function addEvent() { if (counter == limit) {
One person to date has received a runtime error message saying "parent.frameleft.location is not an object" with the following code. The code is used to select 2 frames at the same time...
I am using this browser that came with an sbcglobal account and when I click on the built in "shopping" button (and others), sometimes i get a jscript runtime error. It happens often but not always. It is very annoying. When I launch the debugger I don't know what i am looking at.
My question is. Is there anything I can do to stop this from popping up? Or is this caused by the source from the site?
Is Javascript build in to the browser or is there someway i could update it. Would that help?
Would using a different browser help? I think this is sbcglobals own browser but it might be based on IE.