JavaScript - Not Redirecting Me
I have this code and for some reason my webpage isn't redirecting me to the other webpages this is what I got[CODE]
Similar TutorialsHey all, Does anyone know if there is an effective way to redirect is JS is off? I was thinking of something like Code: <noscript> <meta http-equiv="refresh" content="0; URL=http://www.mydoman.com/jsOff.php"> </noscript> However, I was told by someone I should avoid meta refreshes. Thoughts? Hello everyone, I have a code he <input type="submit" class="submitblog" onclick="document.getElementById('entry_draft').value=0; document.forms['frmNewBlog'].submit();return false;" value="Submit" /> How can i add a redirect page? I mean what is the code that i will add so that when my user click's submit, they will redirect to example.com/mypage Thank you so much. Ive been trying to figured it out but i have no luck at all... So i came up asking for help. Hi, I need help adding a redirect page function to this: Code: addButton('Close', function() { light.close(); },true).open(); Any idea how to do this? This is a function that closes a window, and I want to close it, then redirect to another page. Thanks in advance. Hi guys! I would like to redirect users based on the state they are in to another website address as well as exclude an IP address so they can access my site. I have js API code from MaxMind, but I'm not sure how to do the rest: Code: <script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script> <script language="JavaScript">document.write(geoip_region());</script> An example: Redirect users from PA, DE and NJ to Google.com but exclude IP address 174.343.198.99 so they can access the website even if they are in one of those states. Another example: Redirect users from FL to Google.com, but exclude IP address 123.123.123.12 so they can access even if they are in FL. Thank you SO MUCH! -Jennifer ok i have a little problem. for class i have to make this website and i'm going into it deeper than everyone else in my class. so here's what i need the function to do. its javascript code and it is attached to a textfield form. when the form is submitted it goes to java to see what it should do. java see's if it is one of two things in the if else statement. 1. If (search == "Justin Pernell") then it would go to link a 2. else then it goes to link b P.S. i have justin pernell up there because if the user searches for anything that isn't my name then they go to an error page. now i have all the above code written the only thing i need help with is telling java to go to link a or b. i cant find the code to forward to a url anywhere. and the other thing is it has to open a local file, like ex:"C:/whatever/site.html" can anyone help me out here? Here's my firstly: PHP Code: <?php echo "<script language=\"javascript\" type=\"text/javascript\"> var g_iCount = new Number(); // CHANGE THE COUNTDOWN NUMBER HERE - ADD ONE TO IT // var g_iCount = 6; function startCountdown(){ if((g_iCount - 1) >= 0){ g_iCount = g_iCount - 1; numberCountdown.innerText = 'You must wait ' + g_iCount +' seconds before your download starts'; setTimeout('startCountdown()',1000); } } function top() { setTimeout('startCountdown()',0000); setTimeout('delayer()',6000); } function delayer() { window.location = \"http://www.mediaphiles.net/uploads/".$actualname."\" } </script>"; ?> Don't worry about the $actualname variable, that is working. What I have it doing is when you click a button it starts top() which starts the countdown. Then, after 5 seconds (6 seconds) it redirects. But it doesn't seem to be working. -- I'm new to Javascript so I have no idea what the problem is. I have simple script for my website, I want to redirecting a package tracking and get data from other website that have tracking service, So i try to make this simple field text, once it succesfully work, for 1-2 times, but it seems the script is not complete fungtionally, anyone can tell me where is the incomplete parts? because i think its endless loop of redirecting, and i got error message from chrome/opera/firefox browser this is the script: Code: <label for="basicSearchBox" style="font-size:8pt; font-weight:bold; color:#444444; font-family:'lucida grande',tahoma,verdana,arial,sans-serif;">TRACK & TRACE</label> <form id="basicSearch" name="basicSearch" action="http://www.packagetrackr.com/track/parcelforce/" method="get" target="_blank"> <input name="searchTerms" id="basicSearchBox" type="text" value="" maxlength="200"> <input type="submit" value="Track!" style="background-color:#E5E3CB; border-color:#CAC594; border-style:solid; border-width:0pt 1px 1px 0pt; color:#71672D; font-size:.85em; margin:3px 2px; padding:0.0em; text-decoration:none;"/> </form> </div> Anyone can help? i really thanksful if someone can resolve my problems Friends, I want a simple contact form of 3 fields on my website which emails data on my email address or write a file on my server or just other any way inform me that data. But I dont want that "submit" button redirects to other 'thankyou' page where code is located. Plzzzzzzzz suggest or tell me what I have to do?? Disclaimer 1: I am not a programmer, just a curious designer, so please take that into consideration in your replies. Disclaimer 2: Despite all advices against it, I couldn't find a better solution to my website than using iFrame Disclaimer 3: Before asking for help, I researched *several* forums and although I found people discussing similar issues, I was not successful at adapting their solutions to my needs. Gentlemen, I need your help implementing a method to intercept and redirect external links to a dynamic iframe. By "dynamic" iframe I mean an iframe whose SRC would be filled up in accordance to the external URL being intercepted and that it would resize its HEIGHT accordingly in order to avoid scroll bars. The function for resizing the iframe id="child" is already correctly implemented like so: Code: <script language="JavaScript"> <!-- function calcHeight() { //find the height of the internal page var the_height= document.getElementById('child').contentWindow. document.body.scrollHeight; //change the height of the iframe document.getElementById('child').height= the_height; } //--> </script> and the call Code: <iframe src="/main/index.php" width="100%" onLoad="calcHeight();" height="1" marginheight="0" marginwidth="0" scrolling="no" frameborder="0" id="child"> This what I have going on: - index.html => contains some content and the iframe id="child" - childpage1[...N].php => several PHP pages which I do not want to show up outside of the parent "index.html". These pages use clean URLs from CMS such as "http://mydomain.com/pages/this-is-a-child-page/" Users might click on external links from search engines, for instance, about an specific page such as "http://mydomain.com/pages/this-is-child-page-7/" which obviously would load the page "orphaned", outside "index.html" and that is exactly what I am trying to avoid. Based on what I have researched so far, the best way (please, correct me if I'm wrong) to deal with this would be implementing a test condition on the header of the PHP child pages to verify if they are on "top" or not (if they are already inside the "parent" object "index.html"). If FALSE, the page would load normally, if TRUE, a variable should be created to store the URL of the requested page and passed through the link to the page "index.html" which would be immediately called. In "index.html" there would be a script to collect the variable sent through the link (something like "http://mydomain.com/?var=http://mydomain.com/pages/this-is-child-page-7/") and break the text string apart, store a portion of PATHNAME (in this case, "/pages/this-is-child-page-7/) and use it to replace the current SRC of iframe id="child". Probably, there would have to be another testing function in this script to compare the variable passed from the "orphaned" PHP page against the current value of SRC in iframe id="child" to determine if any action is actually required. This "replacement" function would be called onLoad and if tested true would run and refresh the page with the proper value in the iframe SRC. All this should be accomplished while still making the iframe HEIGHT dynamically adjustable and show a "clean" URL in the browser, such as "http://mydomain.com". The potential issues I foresee is an infinite loop due to two onLoad queries (one for SRC, another for HEIGHT) in the parent and child objects, which might required a merge into a single script. As you can tell, I have an idea of what needs to be done but not a clue on how to get it done. Any help would be greatly appreciated. Thanks, |