HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignHTML Programming

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 July 13th, 1999, 04:09 PM
Marcello
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I've had this new idea for a js, but I am not a programmer (I think it's simple anyway but I've never seen it around)

This is what should happen:

IF USER HOMEPAGE IS NOT "MyUrl" GO TO GOODBYE PAGE

ELSE CONTINUE ON THIS HTML

This is for rewarding people thet have my URL as their homepage, leting them see "secret" pages. I think there is a function to check the URL default as homepage, if not could be done through the nav. history.

Can somebody help me, should be simple for a programmer

Thank you very much

Bye !!!

Reply With Quote
  #2  
Old August 21st, 1999, 12:38 AM
tack
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
make index.html do this:

<body onload="document.location ='friend.html'">

and put this in index2.html:

function check(){
if(window.history.length == 2){
document.location = 'friend.html'
}
}

<body onload="check()">

window.history.length won't tell you if it's the homepage, but it will tell you how many pages have been opened in that window. The onload script in index.html forwards the user to index2.html so that if people bookmark your site, they are actually bookmarking index2.html. So in index2.html, we check() to see if we are the first page this window has loaded (if accessed via bookmark), or the second page. If they actually typed in the URL as their homepage they would have gone to index.html first, so now we know that IF the user has a home page set in their browser, then it is your homepage.

this code is not debugged, and I assume you can figure out how to add it to your site if it's worth it to you.


have fun

dan

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > New IDEA for JS ... nedd help

Developer Shed Advertisers and Affiliates



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

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


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap