Document.location Not Working?
Feb 18, 2010
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";
[Code]....
View 3 Replies
ADVERTISEMENT
Dec 18, 2002
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?
View 6 Replies
View Related
Jun 28, 2002
or is it window.location?
anyway, why doesn't this work?
Any ideas why this doesn't work?
<script language="javascript">
function goclaims()
{
document.location.replace = "../webapplication2/webform1.aspx";
}
</script>
<asp:ImageButton onlick="goclaims();" id="Image5" onmouseover="this.className='applyBorder'" onmouseout="this.className='removeBorder'" runat="server" Width="24px" Height="18px" ImageUrl="file:///C:Documents and SettingsgregbDesktopiconsClaims.ico" CssClass="removeBorder"></asp:ImageButton>
View 3 Replies
View Related
Aug 5, 2009
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.
this is currently what I have
function TableData(headers, row, loc)
{
this.headerArr = headers;
this.rowArr = row;
[Code]....
View 2 Replies
View Related
Aug 19, 2003
I'd like to find the document location during runtime for a script I'm using, and having next to no experience with JavaScript, I don't know how.
For example, if my document is local:
http://localhost/websites/example/script.js
If my site is live:
http://www.example.com/script.js
How can I extract everything but the script name and put it in a variable?
View 2 Replies
View Related
Jul 20, 2005
This will give me the source of the current page.
<a herf="javascript:document.location = 'view-source:'+document.location">testpage.htm</a>
I want to display the source of another page, using something like this but it doesn't work:
<a herf="javascript:document.location = 'view-source:'+'testpage.htm'>testpage.htm</a>
?? Won't work, unless it is saved on a server with http:// in front of it.
View 5 Replies
View Related
Dec 7, 2006
Is there any way to get 'accesskey' to work with document.location.href?
I'm using a set of functions as link generators and this is what I'm "stuck with" using.
View 3 Replies
View Related
Mar 28, 2011
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("/");
[Code]....
View 8 Replies
View Related
Mar 3, 2009
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 ?
View 1 Replies
View Related
Jul 23, 2005
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.
View 2 Replies
View Related
Aug 5, 2011
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.
View 9 Replies
View Related
Oct 14, 2011
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.
View 1 Replies
View Related
Jul 7, 2009
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...
View 4 Replies
View Related
Mar 23, 2009
The code works fine in every browser except for IE, and am wondering why...
Code:
<script type="text/javascript">
window.onbeforeunload = null;
$(document).unbind("m1");[code]...
Googling got me some people experiencing problems in there's a charset, and I did have one. Even taking it out, it still won't redirect. If I put <?php echo 'Ok'; ?> just before <script>, it'll print it out in IE, so, I know that it's getting to this point.... Just don't know why it isn't actually going to the location.replace URL.
View 1 Replies
View Related
Jun 13, 2007
The following JS script works fine in FF and IE7. It fails though in IE6, which happens to be my target audience. Whats failing is.. the window.location is not calling.
function confirmation(text,url_link) {
var answer = confirm(text)
if (answer){
window.location = url_link;
}
}
View 2 Replies
View Related
Feb 11, 2010
Ok I have tried and tried and cannot get this code to work in safari or google chrome.
Basically I am working on a shopping cart. The user will click the paypal pay now button. The form is submitted to paypal via a new window target="_blank"
I also need to refresh the current page. This will write shopping cart data to DB via php upon page refresh.
Safari and google Chrome will open the paypal window, but seems to ignore the javascript to refresh the browser.
FF and IE both work fine.
<script LANGUAGE="JavaScript">
function newPage() {
self.location.href='https://www.artists2you.com/s/orderconfirm.php?ordernumber='.$_SESSION['ordernumber'].'';
[Code]....
View 2 Replies
View Related
May 11, 2010
fixing window.location.href on localpath is not working in Firefox only but working fine in IE.
View 1 Replies
View Related
Jan 26, 2009
i try to open my local system share folder in browser using command window.location= 'file:\c:sharefolder'; where the folder sharefoler is in c; and it is shared it is not opening in firefox and Google Chrome
View 6 Replies
View Related
Jul 23, 2005
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.
View 2 Replies
View Related
Nov 17, 2010
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?
View 1 Replies
View Related
Jun 9, 2009
I have a real problem with an e-commerce site which has worked for years without a hitch but with the uptake of IE8 (it seems) this problem is getting more and more frequent Problem: customer continues through checkout on main site (http:[url]....).
When they have to enter their credit card details, they click on a link to open a window (https:[url]....). The details are verified and if valid, the customer is returned to the confirmation page in the parent screen (http:[url]....) and the payment window is closed . Pop-up blockers are causing problems here but even when pop-up blockers are disabled, the confirmation page loads in a new window.I'm using :
<script language="JavaScript">
<!--
window.opener.location="<?php echo ($main_url);?>thanks.php>";[code].....
But the page always loads in a new window and not the parent window.Is there any way to load the confirmation page in the parent window?
View 1 Replies
View Related
May 6, 2011
I have this [code]...
It works perfectly fine in IE but it won't work in firefox. Both link and var does not appear in the URL when I get to index.php.
Can anyone explain why? How is it not working in firefox?
View 1 Replies
View Related
Jun 8, 2009
I have a real problem with an e-commerce site which has worked for years without a hitch but with the uptake of IE8 (it seems) this problem is getting more and more frequent. Problem: customer continues through checkout on main site [URL] When they have to enter their credit card details, they click on a link to open a window ([URL]). The details are verified and if valid, the customer is returned to the confirmation page in the parent screen ([URL]) and the payment window is closed. Pop-up blockers are causing problems here but even when pop-up blockers are disabled, the confirmation page loads in a new window.
[Code]...
View 1 Replies
View Related
Mar 24, 2011
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?
View 1 Replies
View Related
Mar 24, 2010
I am trying to use document.getElementById in FF but its not working. There is a main page. in that mainpage there is a iframe and in that iframe (id = DocFrame) there is a textbox (id="fileuploadedcnt") which i am trying to access. there is no error. ofcourse i have given name and id to the textbox. Below is the code
function ConfirmCertificate(id , Project_ID , Subprogram_ID , ITCType_TI) {
frm=document.mainform;
//fileuploadedcnt = (document.frames("DocFrame").document.forms("upload_form").elements("fileuploadedcnt").value);
[Code].....
In the abpve case i tried both the name and id properties. with Name property i get the HTMLObj alert but again it fails if i attach value method. And for id, it doesnt work at all
No errors ofcourse in both the cases
View 6 Replies
View Related
Jun 2, 2010
I have the following code. It is not working for firefox, IExplorer and Opera.
<script id="url" name="url" language="JavaScript" type="text/javascript" src=""></script>
<script language="JavaScript" type="text/javascript">
var u = document.getElementByName("url");
[Code]....
View 13 Replies
View Related