SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Dec 2005
    0 Post(s)
    0 Thread(s)

    Activate another script in the background!

    I'm trying to figure out how to activate another script using jquery and send some variables to this, but cant seem to get a start...

    I don't need any feedback from the script, just want to run it. Here is where I have started:
    var url = "2.php?test=mig";
    	type: "POST",
        url: url,
        data: ''
    I'm not sure this is the right way... Please help :-)

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Melbourne, AU
    17 Post(s)
    1 Thread(s)
    Have you looked for errors in your browser console? See the following for debugging tools

    Firefox - Firebug (Downloadable Extension)
    Chrome - Web Inspector (Native - F12)
    Safari - Web Inspector (Native - F12)
    IE - Development Tools (Native - F12)
    Opera - Dragonfly (Native - F12)
    Blog/Portfolio | Evolution Xtreme | DFG Design | DFG Hosting | CSS-Tricks | Stack Overflow | Paul Irish
    Having lame problems with your code? Let us help by using a jsFiddle

  3. #3
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Bournemouth, South UK
    1 Post(s)
    0 Thread(s)
    You don't need jquery to do this. You don't need the return true; at the end and you'd only need 2 script elements if you want to send requests asynchronously. Only one will suffice as JavaScript is kept in memory even though the element that it loaded from has been changed. Just change the URL to a php one and make sure the header of the php is set to output as JavaScript. If the returned script is dynamic you'll also need either a no-cache header or add a timestamp to the querystring
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


Posting Permissions

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