JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 5th, 2008, 02:58 PM
ajwtech ajwtech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 4 ajwtech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 2 sec
Reputation Power: 0
Redirection issue

how do I make a page redirect traffic unless called by a certain page

update*

ok what im trying to do is to redirect traffic from certain pages back to my index page and the call the page it was redirected from in an iframe.

Last edited by ajwtech : May 5th, 2008 at 03:09 PM. Reason: not enough info

Reply With Quote
  #2  
Old May 5th, 2008, 09:29 PM
Arty Effem's Avatar
Arty Effem Arty Effem is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2006
Location: England
Posts: 214 Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level)Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level)Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level)Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level)Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level)Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 14 h 44 m 36 sec
Reputation Power: 30
Quote:
Originally Posted by ajwtech
how do I make a page redirect traffic unless called by a certain page

update*

ok what im trying to do is to redirect traffic from certain pages back to my index page and the call the page it was redirected from in an iframe.
That requires two scripts.
The child document has to check whether or not it is contained in a frame, and if not redirect to the parent with a querystring parameter, which the parent reads to determine which page to load into the iframe.

Code:
if(self==top)
 location.href='http://myurl.com?load=framedDoc.htm'


Then the parent document would have to act on any parameter, perhaps something like this:

Code:
var ifDoc;
if( (ifDoc=location.search.match(/\bload=(.+)&|$/)) )
 document.getElementById('theIframe').src=ifDoc[1];
Comments on this post
PHP-Newb agrees: ==

Last edited by Arty Effem : May 7th, 2008 at 05:27 PM.

Reply With Quote
  #3  
Old May 6th, 2008, 09:55 PM
ajwtech ajwtech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 4 ajwtech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 2 sec
Reputation Power: 0
...

thanks a lot for your response. could you clarify the second function i dont normally javascript.

thanks again.

adam

Reply With Quote
  #4  
Old May 7th, 2008, 05:32 PM
Arty Effem's Avatar
Arty Effem Arty Effem is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2006
Location: England
Posts: 214 Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level)Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level)Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level)Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level)Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level)Arty Effem User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 14 h 44 m 36 sec
Reputation Power: 30
Quote:
Originally Posted by ajwtech
thanks a lot for your response. could you clarify the second function i dont normally javascript.

It extracts the value of the load parameter passed in the querystring and uses it as the URL for an iframe with the id 'theIframe'.
Just change the id to match that of your iframe.
You must place the script block somewhere below the relevant <iframe> tag.

Reply With Quote
  #5  
Old May 7th, 2008, 05:40 PM
Joseph Taylor's Avatar
Joseph Taylor Joseph Taylor is offline
Text Ninja
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2005
Location: Vancouver, British Columbia, Canada
Posts: 596 Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 1 h 12 m 43 sec
Reputation Power: 107
Send a message via Skype to Joseph Taylor Send a message via XFire to Joseph Taylor
There's a little bug in that regex... It should look more like the one posted below; otherwise the iframe will be redirected every time, and possibly to the wrong location.

Code:
/\bload=(.+?)(?:&|$)/

Reply With Quote
  #6  
Old May 7th, 2008, 09:38 PM
ajwtech ajwtech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 4 ajwtech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 2 sec
Reputation Power: 0
thank you that was becoming an issue.

btw good eye

Reply With Quote
  #7  
Old May 7th, 2008, 09:43 PM
ajwtech ajwtech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 4 ajwtech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 2 sec
Reputation Power: 0
bload

what is bload?

Reply With Quote
  #8  
Old May 8th, 2008, 04:40 AM
Joseph Taylor's Avatar
Joseph Taylor Joseph Taylor is offline
Text Ninja
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2005
Location: Vancouver, British Columbia, Canada
Posts: 596 Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 1 h 12 m 43 sec
Reputation Power: 107
Send a message via Skype to Joseph Taylor Send a message via XFire to Joseph Taylor
"bload" is meaningless. \bload, on the other hand, means (in the context of a regular expression) "a word boundary followed by the plaintext load". To learn more about special characters in regular expressions, visit regularexpressions.info or read Mastering Regular Expressions.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Redirection issue


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway