SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Tennessee
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry URL onclick help!

    hey all i am trying to figure out how to go about getting my onclick= to goto a page i have.
    Code:
    function theboxNotFinished(a){
    var theSaying = "";
    var a2= arguments;
    var theURL= window.location.href;
    var theURL= theURL.replace(/register.asp/, "ads.asp");
    		 
    for(var i=0;i<a2.length;i++){
    if (a2[i]){theSaying = a2[i] + theSaying}}MOOdalBox.open("../js/oops.html", theSaying + '<br />' + "<img src='file:///c:/ChattanoogaFB/images/ButtonOK.png' alt='' width='260' height='100' onclick='location.href=theURL'>", "750 50")}
    Doesn't work still... Keeps telling me that the theURL is not defined when it gets to the location.href=theURL????????

    Thanks

    David

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Tennessee
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i finally got it!
    Code:
    function theboxNotFinished(a){var theSaying = ""; var a2= arguments; var theURL= window.location.href; var theURL= theURL.replace(/register.asp/, "ads.asp"); for(var i=0;i<a2.length;i++){if (a2[i]){theSaying = a2[i] + theSaying}}MOOdalBox.open("../js/oops1.html", theSaying + '<br />' + "<img src='file:///c:/images/ButtonOK.png' alt='' width='260' height='100' onclick=document.location.href='" + theURL  + "'>", "750 50")}
    David


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •