Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Problem with window.location
Old 08-15-2010, 04:10 PM Problem with window.location
etrader's Avatar
Experienced Talker

Posts: 37
Trades: 0
Following discussion in this thread; I used this code for simple redirection of my page

Code:
<script>
window.location.href = "http://www.new-url.com";
</script>
As I want to have a track of my visitors; I put tracking codes (both in php and Javascript) before the above code.

This works well on Firefox, but when browsing with IE, it simple redirects to the target page without reading the tracking codes.

__________________

Please login or register to view this content. Registration is FREE
etrader is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-16-2010, 01:44 AM Re: Problem with window.location
gkphp's Avatar
Novice Talker

Posts: 5
Name: sivasankar.gk
Location: chennai
Trades: 0
Can u provide the exact code you have written, so that its easy to access what's wrong in it..
gkphp is offline
Reply With Quote
View Public Profile
 
Old 08-16-2010, 05:17 AM Re: Problem with window.location
etrader's Avatar
Experienced Talker

Posts: 37
Trades: 0
Thanks for your kind attention; the code is

Quote:
<html>
<head>
<title>Redirecting to Google</title>
<script language="JavaScript" src="stats.js"></script>
</head>
<body>
<script language="javascript" type="text/javascript">
<!--
stats(893665);
//--></script>

<script language="javascript" type="text/javascript">
window.parent.location="http://www.google.com"
</script>

</body>
</html>
__________________

Please login or register to view this content. Registration is FREE
etrader is offline
Reply With Quote
View Public Profile
 
Old 08-16-2010, 06:02 AM Re: Problem with window.location
Super Talker

Posts: 139
Name: John Davis
Trades: 0
IE executes code as it comes. But rest included JS files mya be not load yet. Therefore you have to make redirect after reading the tracking codes done only.
You may to include redirect code to the end of reading the tracking codes script.
__________________
»
Please login or register to view this content. Registration is FREE
- Interactive maps for websites
»
Please login or register to view this content. Registration is FREE
for web developers
MapMaster is offline
Reply With Quote
View Public Profile Visit MapMaster's homepage!
 
Old 08-16-2010, 06:17 AM Re: Problem with window.location
gkphp's Avatar
Novice Talker

Posts: 5
Name: sivasankar.gk
Location: chennai
Trades: 0
or else you can have the redirect inside your stats function ,

like this,

Quote:
function stats()
{
// function definition goes here

window.parent.location="http://www.google.com";
}
gkphp is offline
Reply With Quote
View Public Profile
 
Old 08-16-2010, 10:57 AM Re: Problem with window.location
etrader's Avatar
Experienced Talker

Posts: 37
Trades: 0
Thanks fellas, but can you tell me exactly how the final code should look like?
__________________

Please login or register to view this content. Registration is FREE
etrader is offline
Reply With Quote
View Public Profile
 
Old 08-18-2010, 05:17 AM Re: Problem with window.location
Super Talker

Posts: 139
Name: John Davis
Trades: 0
Move redirect code into stats(), to the end of this function.
__________________
»
Please login or register to view this content. Registration is FREE
- Interactive maps for websites
»
Please login or register to view this content. Registration is FREE
for web developers
MapMaster is offline
Reply With Quote
View Public Profile Visit MapMaster's homepage!
 
Old 08-30-2010, 05:47 AM Re: Problem with window.location
Banned

Posts: 19
Name: Hanna
Trades: 0
don'tknow why this works mozilla and the other versions like IE don't - but it works.
hanna_depp is offline
Reply With Quote
View Public Profile Visit hanna_depp's homepage!
 
Reply     « Reply to Problem with window.location
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.86173 seconds with 12 queries