Link to home
Start Free TrialLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

Javascript homepage button acting wierd

Here's my code:

<INPUT TYPE="image"  SRC="images/homepage_button.jpg" width="200" height="17" border="0" onClick="this.style.behavior='url(#default#homepage)';
                        this.setHomePage('http://www.countryshowdown.com/Texaco/contestant.php?id=<?php echo $contestant_id; ?>');">
                        </FORM>&nbsp;

It works. My homepage becomes the page I've got referenced. The only snag is that as soon as youc click the button, the page gets an error because the URL has some random code as the id number, consequently you get all kinds of errors.

Again, the page is made the homepage, but in the process the page refreshes with the same URL, but you've got a different set of characters for the id number. In this case, instead of the URL being http://www.countryshowdown.com/Texaco/contestant.php?id=19022, instead the page you get after you click the button is http://www.countshowdown.com/Chevron/contestant.php?x=80&y=10

What am I missing?
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What are you trying to get to happen here.  Please just tell us in plain language, thanks. ~Ray
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bruce Gust

ASKER

Dave's suggestions explained where I was getting the bizarred URL (the x and y coordinates). I found another script that accommodated the button that I wanted to use as well as different browser types. That "direction" came about as an indirect result of Ray's suggestion which had sound code, but didn't accommodate anything other than IE. Taken together, we got it done!
Good, glad you got it done.  Thanks.