SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Norcross, GA
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <html>
    <SCRIPT language=JavaScript>
    
    	function test(Text) {
    		var shell = new ActiveXObject("WScript.shell");
    		shell.run("TL.EXE " + Text,10);
    	}
    	
    </script>
    <body>
    <p><a href='test.php3' onclick=test(p9)>Click</a>
    </body></html>

    I need to pass an id (in this case 'p9') to the function when the link is clicked.

    There are no errors, but the process does not work.

    Ideas?

  2. #2
    SitePoint Addict
    Join Date
    Mar 2001
    Location
    the windy city
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try putting "p9" in quotations when passing to a function.

    <body>
    <p><a href='test.php3' onclick=test("p9")>Click</a>
    </body></html>

    Hope, it can do the trick

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Norcross, GA
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You rock. That did the trick.

  4. #4
    SitePoint Addict
    Join Date
    Mar 2001
    Location
    the windy city
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ha, I had exactly the same problem about a month ago and it took me about 3 hours to figure that out!!! whenyou pass a string type variable to a function you always have to enclose it in quotes.

  5. #5
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    D¨n ╔ideann, Alba
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I had a similar problem today (infact the past few days) with passing two parameters from an hyperlink to a function in an external JS file. Everything worked perfectly in NS6, IE5+ and Navigator, but IE4 refused to play ball.

    Anyone got an inkling as to the problem?

    Cheers. Scot-Bot.

  6. #6
    SitePoint Addict
    Join Date
    Mar 2001
    Location
    the windy city
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't know off hand. Some code might help, though


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
  •