![]() |
|
#1
|
|||
|
|||
How do web redirection scripts work?Good Morning, I'm a big rookie web designer and I created my website for 3 different sizes/resolutions (640x480, 800x600, 1024-76
Thank you for your time. |
|
#2
|
||||
|
||||
|
To quickly answer your first question: No, you do NOT need 3 different domain names!
How do re-direct scripts work? That depends on what you're trying to do... For a user based width setting for your layout, I would assume you are planning to set a cookie, get JavaScript to figure out the screen width, set the value in a cookie then 'refresh' the current page to read the cookie value already set for the user's screen width? __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
|
Thanks for the info JdS
|
|
#4
|
|||
|
|||
|
Hi JDS. I went ahead and tried the redirect script and maybe you can shed some light on this. I added the redirect script and kinda work, what I mean is that it does redirect the page, unfortunately I designed my website in frames. My webpage has 3 frames a banner, middle/body, and a footer. I added the script to the middle frame because I cant & dont know where to add the script in the index page of a framed website, or if you can even add the script to the index page of a frames website. The script I added looks like this:
<script language="JavaScript1.2"> <!-- if (screen.width==800||screen.height==600) //if 800x600 window.location.replace("http://uniteddistributorscanada.hypermart.net/") else if (screen.width==640||screen.height==480) //if 640x480 window.location.replace("http://uniteddistributorscanada.hypermart.net/") else if (screen.width==1024||screen.height==76 window.location.replace("http://uniteddistributorscanada.hypermart.net/1024x768") else //if all else window.location.replace("http://uniteddistributorscanada.hypermart.net/1024x768") //--> </script> If you go to the website you'll notice depending on the resolution that you have the entire new page is redirected into the main body of the framed site (where I added the script). Is there any way to fix this, and have the whole page redirect. You can view the website at: http://uniteddistributorscanada.hypermart.net/ Thanks again PS: heads up on the pop ups |
|
#5
|
||||
|
||||
|
I believe you have to add it in the index page. Put it inside the <head></head> tag.
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business. |
|
#6
|
||||
|
||||
|
I would suggest you dith the frames...
Frame sites do not look that great at all. It especially stinks when you want to be indexed by a search engine. __________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business. |
|
#7
|
|||
|
|||
|
Hi, and thanks for the info guys. Believe me, I realized later that I should have designed it in frames. I did what you said and found the index.htm and added a script I found on the net to my frames website, and the free script looks like this:
<script language="JavaScript1.2"> <!-- /* Screen Size Redirect script (By Robert @ http://members.tripod.com/technological_tinker/) Submitted to Dynamicdrive.com to feature script in archive For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com */ if (screen.width==800||screen.height==600) //if 800x600 window.location.replace("http://www.netscape.com") else if (screen.width==640||screen.height==480) //if 640x480 window.location.replace("http://www.microsoft.com") else if (screen.width==1024||screen.height==76 window.location.replace("http://www.dynamicdrive.com") else //if all else window.location.replace("http://freewarejava.com") //--> </script> So I just altered the script and added the urls to it, and this is what it looks like in my index page: <script language="JavaScript1.2"> <!-- /* Screen Size Redirect script (By Robert @ http://members.tripod.com/technological_tinker/) Submitted to Dynamicdrive.com to feature script in archive For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com */ if (screen.width==800||screen.height==600) //if 800x600 window.location.replace("http://www.uniteddistributors.ca") else if (screen.width==640||screen.height==480) //if 640x480 window.location.replace("http://www.uniteddistributors.ca") else if (screen.width==1024||screen.height==76 window.location.replace("http://www.uniteddistributors.ca/1024x768/") else //if all else window.location.replace("http://www.uniteddistributors.ca/1024x768/") //--> </script> I added to the frames index.htm page & tested it out, and it seemed to work perfectly. I did a few other touch ups and uploaded it & when I viewed it, it didnt redirect. If your rez is at 800x600 and you visit the site at: http://www.uniteddistributors.ca/ it looks alright, but if your rez is 1024x768 it wont redirect to the 1024x768. I tested it out to see if the pages are on the web by typing the url directly and its there: http://www.uniteddistributors.ca/1024x768/ Do you know, whats wrong? I have a funny feeling its something very simple. If there's any help you can give I'd appreciate it. Thank you |
|
#8
|
|||
|
|||
|
Hi guys, I finally got it working correctly. Thank you very much for the help
Rhino1616 |
|
#9
|
||||
|
||||
|
Sorry rhino, everyone who is a regular here knows that my JavaScript knowledge is simply 0.... but I am GLAD you got it working finally.
Care to explain what the fix was? If we're lucky this thread may get a few more views off the Search Engines for the issue. It will help others if this thread ended in a workable solution. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#10
|
|||
|
|||
|
Hi JDS, actually it wasnt anything major it was a typo & placement error on my part. I had typed the wrong url to redirect to, and the second error is that I uploaded 2 index pages to the web which in turn confused the Javascript that was inserted into my homepage. Sometimes its the simple things that can coinfuse us the most.
Thanks again JDs |
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| probelm with apache redirection configure | pelegk2 | Apache Web Server Forum | 2 | 14-Dec-2003 04:18 |
| Why doesnt my form work correctly? | rhino1616 | Web Design Forum | 2 | 06-Nov-2003 17:21 |
| Another excuse not to go to work? | Garth Farley | Open Discussion Forum | 1 | 19-May-2003 15:52 |
| Why doesnt my autorun CD work on other computers? | rhino1616 | Computer Software Forum - Windows | 3 | 01-May-2003 18:23 |
| I have 3 cgi scripts working in Tripod | Guest | Free Web Hosting | 0 | 11-Jul-2002 14:07 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The