Javascript Redirect Not Working?
Jul 17, 2002
I have a Javascript redirect on pages inside my site (not the index page) because Netscape 4+ doesn't see the CSS properly. I'd tested it at home, and it worked fine. But now testing it on another computer, its not redirecting. Code:
View 3 Replies
ADVERTISEMENT
Jul 21, 2011
I have data pages in my e-commerce site (from 1999) that are imbedded in a parent page using the object tag. I have started to include a little JS snippet that is intended to redirect to the parent if the embedded pages are loaded separately:
<script language="JavaScript" type="text/javascript">
try { if (top == self) {top.location.href='parentpage.htm'; } } catch(er) { }
</script>
This works fine in Firefox, but in IE 7 and 8 it gets into an infinite loop of reloading the parent page into the object frame.Here is a sample:http://www.greathallminis.com/Ancient_15mm/darkages_anc15_mm.htm(I've left this page with the issue, while I have excluded the script for IE elsewhere.)
View 3 Replies
View Related
Feb 12, 2010
This script is supposed to redirect IE 5 to a page on my site. However, the code is not doing the redirect part. Take a look:
/*******************************************************************************
OLDIE - or Old IE. A script that finds the version of IE you're using,
and redirects if lower than the set parameter.
[[ Created by Ryan McLaughlin, www.DaoByDesign.com ]]
*******************************************************************************/
var browser= navigator.appName
var ver= navigator.appVersion
[Code].....
I also would like to point out that the code belongs in a .js file. NOT <script type="javascript".........
View 6 Replies
View Related
Jul 23, 2005
How can i use javascript to redirect the url in the drop list box once the event onchnage is triggered?
View 1 Replies
View Related
Feb 10, 2009
I have a simple ajax request that is supposed to (after a short timeout) redirect the page to the URL that the server sends back but it just wont work. It does work without the setTimeOut() function however.
var http = false;
if(navigator.appName == "Microsoft Internet Explorer") {
http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
http = new XMLHttpRequest();
}
function go() {
var u = "http://site.com/";
http.open("GET", "go.php?" + "u=" + u, true);
http.onreadystatechange=function() {
if(http.readyState == 4) {
var redirURL = http.responseText;
setTimeout("window.location.href = redirURL;" , 2000);
} }
http.send(null);
}
View 2 Replies
View Related
May 11, 2010
I'm trying to write very basic page that just takes input from a text box, processes it with a function called DoSearch() when you click the submit button, then redirects to the Google equivalent to display Google's search results. If I put a redirect in the body section it works fine. I've also added an alert in the function and that works fine, but the redirect doesn't. I'll post the source below because it's only short:
HTML Code:
<html>
<head>
<title>Homepage!</title>
<script type="text/JavaScript" language="javascript">
function DoSearch(){
var query = document.SearchForm.query.value;
var url = "[URL]"+query+"&aq=f&aqi=g10&aql=&oq=&gs_rfai=";
alert(url);
location.replace("[URL]");
}
</script>
</head>
<body>
<center>
<form name="SearchForm">
<input type="submit" value="Search!" name="Search" onclick="DoSearch()" />
<input type="textarea" name="query" size="38" />
</form>
</center>
</body>
</html>
View 4 Replies
View Related
Aug 26, 2011
i have a form that submits into an API, and one of the fields is for where the page should redirect after a successful submission.
So i'm using Javascript to take the onpage fields and make the proper redirect URL.
This method works in Chrome, and IE - however not in firefox.
better methods for this to be valid in FF?
[Code]....
p.s - what do your javascript guys prefer i wrap my code in? CODE?
View 1 Replies
View Related
Jun 6, 2009
Im looking for a simple code to redirect to a specific URL on any click on page and redirect to certain url after a certain number of page views.
View 18 Replies
View Related
Oct 7, 2009
javascript:history.go(-2) makes it go two pages back for links but how do u put it in the script tags just when the page loads go back 2 pages?
View 1 Replies
View Related
Apr 19, 2010
I have a javascript that I found for an iphone style menu. It works and allows me to click through the menu as long as it is within the list system. If I try to create an external link to a webpage. It doesn't load anything. Here is the code let me know if anyone knows the trick so I can link out. Below is the javascript used to create the flowing menu system. Let me know if you need the rest of the .css and html.
(function() {
var animateX = -20;
var animateInterval = 24;
var currentPage = null;
var currentDialog = null;
var currentWidth = 0;
var currentHash = location.hash;
var hashPrefix = "#_";
var pageHistory = [];
[Code]...
View 1 Replies
View Related
Jan 24, 2007
I have a problem with some JavaScript code not working. I'm sure I've
done something obviously stupid, but I can't for the live of me figure
it out.
This is the XHTML document (stripped to the relevant parts):
View 12 Replies
View Related
Aug 15, 2007
Im using Javascript to expand a unordered list menu and it works on my pc in the latest versions of Opera, Safari, Firefox and IE. But i have been told that the buttons do not work in Safari on a MAC. It does however work in IE on a MAC.
Is there a difference between the way Safari on a MAC would read the code? Code:
View 1 Replies
View Related
Jun 4, 2007
I have a DHTML menu that I created on a site that shows a submenu when you hover over the main navigation.
Everything seems to work fine except when you view the site in I.E. on a Mac. The subnavigation does not show up. Does anyone have any ideas?
View 5 Replies
View Related
May 21, 2002
I am just finishing a site for a photographer which uses Flash for the interface, PHP to display a number of image thumbnails (4 scripts, depending on the route the visitor has chosen) and then 1 PHP page with lots of JavaScript to open the correct image in a new popup window.
It all works in the latest versions of NN & IE but the problem is that some of the site owners' clients use older browsers and the JavaScript popups are not working in NN 4.7.
The address of the developing site is here. The JavaScript that I am using is an adaptation of Anarchos' great script.
Are there fundamental things I am missing regarding NN 4.7 and JavaScript or would my scripting in JavaScript be wrong?
View 8 Replies
View Related
Aug 21, 2000
Can anyone recommend a good place for someone like myself to start learning about JavaScript and Java Applets? I know HTML, CSS, and a decent amount of Perl and PHP, but overall have VERY little experience with Java and JavaScripts, other than the usual cut-and-paste...
View 4 Replies
View Related
Jul 23, 2005
I have a new (XP) version of IE, but when I click on links that are
javascript they do not seem to work and suggestings?
View 3 Replies
View Related
Mar 30, 2006
I am using Regular Expressions and Javascript to validate a form,
specifically I want to make sure that if they try to upload a file that
it has a proper name w/ certain extensions (doc,pdf, rtf). The script
works on IE and Mozilla but fails on Safari on the MacOSX. Here is my
code..
// ok files with proper extension
var reOKFiles = /^([a-zA-Z].*|[1-9].*).(doc|DOC|pdf|PDF|rtf|RTF)$/;
//where i check for the file...
if(window.document.myForm.myDocument.value != ""){
var fileStr = window.document.myForm.myDocument.value;
if(!reOKFiles.test(fileStr)){
alert("Please try again, you tried to upload an invalid file type
for CRITERIA 1");
window.document.myForm.myDocument.focus();
return (false);
View 6 Replies
View Related
Oct 11, 2005
var i = 0;
var max = 100;
function showMenu() {
for(i = 0; i < max; i++) {
setTimeout("document.getElementById('contextlinks').getElementsByTagName('UL')[0].style.filter = 'alpha(opacity="+i+")'",100);
} }
This is supposed to increment the alpha opacity of the UL inside the DIV contextlinks by 1% every 0.1 seconds (for a fade effect). However when the function is activated, the opacity is set directly to 100% rather than increasing bit by bit.
View 2 Replies
View Related
Feb 10, 2006
Looks fine in IE and Opera, but is designed to write into a textarea instead of the <div> if the brower is not IE4+ (why is it working in Opera?) so on Firefox you can see the ugly textarea....
Is there a way to either turn off the Javascript in Firefox so it doesn't work at all, or test specifically for that browser (it's not testing for anything but IE right now as I understand it) and put the text into an absolutely positioned element? Code:
View 2 Replies
View Related
Jun 9, 2006
I stumbled upon a strange behaviour of the XMLHttpRequest.. Maybe I'm
just not well informed enough about its possibilities, so could someone
please confirm my question?
When I put plain javscript in a file that is read-in through a
XMLHttpRequest-object, it's like it is totally ignored. Eg. I have the
file ajax_include.html with in it's body the following lines
<script type="text/javascript" language="javascript">
alert('some alert');
</script>
when I directly surf to the file, the alert pops up as expected, but
when I use a simple XMLHttpRequest to replace the contents of a div
with the contents of this page, the alert is not popping up, although
when I view the selection's source (Thank you, Firefox!), it is there!
When I place an anchor with an onclick-action (eg. alert('onclick')),
it works when I click it.
So my "conclusion" is that it seems like inline javascript commands are
ignored (functions not recognized etc.). All actions assigned to other
events work nice though.
Can someone confirm this strange behaviour? Or is it just normal with
the use of an XMLHttpRequest opbject?
View 1 Replies
View Related
Jul 15, 2002
Perhaps this is a silly question (if so I apologise in advance), but I'm a low-level paper-shifter/part-time Web designer in UK Government and I've designed our Company's site.
Problem is like most Government Depts. trying to do anything involves much liasing with other Depts and much paper-shifting.
We have no Servers or Hosting capability ourselves so this part of the site is handled by (guess what?) another Government dept.
Many months ago I asked them to put a redirect on a number of older URLS for our site which were still being linked to by a large number of other sites.
I was reliably informed this had been done and checked the URLS and all seemed okay.
However I have just recently done a search for our site on AltaVista and the top hit is a subdirectory of the old URL with no re-direct seemingly in existence.
Question is if you put a redirect on a particular URL will it/should it always also include the subdirectories within that URL?
View 4 Replies
View Related
Jul 23, 2005
I am trying to use the onunload event to know when the user closes a
popup by receiving a request on the web server.
I have a main page from where the user opens a popup. What I want is
when the user closes the popup, it sends a request to my web server
(GoAhead) using the onunload event, then closes the popup.
For the moment, this what i have: when the user closes the popup, I
use the onunload event to open a different popup (by this way, I get a
request on the web server and I know that the user closes the first
popup), then, this new popup closes itself with the onload event. It
is working but having this second popup opening and closing is not
very neat.
If I try to change the location of the first popup in the onunload
event: onunload="document.location='....'", it doesn't send a request
to the web server when the user closes the popup.
Is there a way to send a request to the webserver when the user closes
the popup without the need to have an extra popup opened and closed ?
The web server I am using is working on a pseudo "cgi" mode called
"goforms", it avoids to create a different process for each request.
With "goforms", each request is handled by a unique process which is
always running.
View 3 Replies
View Related
May 18, 2006
I hava a snippet below. This code will
redirect my current web page to http://www.xyz.com . . .
But I want to specify the number of seconds before it is redirected.
May I know how to do this? (As much as possible, meta tags should not
be used.)
<SCRIPT LANGUAGE="JavaScript">
<!--
window.location="http://www.test123test1111.com";
// -->
</script>
View 8 Replies
View Related
Sep 13, 2006
My objective is to redirect to another web page after download is
complete.
I have an activeX called to download a few dlls using the following
code
document.writeln(' <OBJECT ID="MQC" ');
document.writeln(' CLASSID="CLSID:98c53984-8bf8-4d11-9b1c-c324fca9ca"
');
document.writeln(' CODEBASE="test.ocx#Version=9,1,0,4359"');
document.writeln(' WIDTH=100% ');
document.writeln(' HEIGHT=100% >');
document.writeln(' <PARAM NAME="DomainPassword" value=""');
document.writeln(' <PARAM NAME="RootURL" value="' + getTdRootURL()
+'"');
document.writeln(' </OBJECT>');
I tried redirecting in the onLoad event of the form but doesn't work. I
suppose it redirects as soon as the activeX is loaded and not when it
has finished its download.
View 1 Replies
View Related
Nov 28, 2006
I would like to redirect say from http://mysite.co.uk to
http://www.mysite.co.uk but because my home page is html I have to use JS
View 5 Replies
View Related
Mar 30, 2010
I have a form in which i have a dropdown list and a submit button. I want to code so that when users select the value from the dropdown list, it should redirect then to the specified page. For instance i have the value, "car", "House" and "pets" in my dropdown listbox, if a use click on "car" it should redirect them to the car page. I have done the following code, but something seems not to work :(
And in the submit button am calling the function move()
My form name is sell and the dropdown list menu is cat.
View 4 Replies
View Related