Get query string value in 3rd party javascript

  • (2 Pages)
  • +
  • 1
  • 2

23 Replies - 1075 Views - Last Post: 24 June 2013 - 07:10 PM

#16 travesty  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 68
  • Joined: 04-June 13

Re: Get query string value in 3rd party javascript

Posted 24 June 2013 - 04:41 PM

it says "Failed to load resource http://localhost/ProjectAds/show_ad.js?var=hi"
Was This Post Helpful? 0
  • +
  • -

#17 laytonsdad  Icon User is online

  • Cheese and Sprinkles
  • member icon

Reputation: 449
  • View blog
  • Posts: 1,936
  • Joined: 30-April 10

Re: Get query string value in 3rd party javascript

Posted 24 June 2013 - 06:17 PM

It can't find the resource because it is looking for http://localhost/Pro...ow_ad.js?var=hi as the src of the js script.

I posted this earlier. :bigsmile:/>

This post has been edited by laytonsdad: 24 June 2013 - 06:18 PM

Was This Post Helpful? 0
  • +
  • -

#18 travesty  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 68
  • Joined: 04-June 13

Re: Get query string value in 3rd party javascript

Posted 24 June 2013 - 06:23 PM

View Postlaytonsdad, on 24 June 2013 - 06:17 PM, said:

It can't find the resource because it is looking for http://localhost/Pro...ow_ad.js?var=hi as the src of the js script.

I posted this earlier. :bigsmile:/>/>

When its named "test.js" it can find it, and for some reason now it doesn't return "undefined" and acually works. Same code its just named different. Do you know why "test.js" would work and not "show_ad.js"? They have the same exact code.
Was This Post Helpful? 0
  • +
  • -

#19 laytonsdad  Icon User is online

  • Cheese and Sprinkles
  • member icon

Reputation: 449
  • View blog
  • Posts: 1,936
  • Joined: 30-April 10

Re: Get query string value in 3rd party javascript

Posted 24 June 2013 - 06:39 PM

In the src of the script are you calling test.js or test.js?v=1&b=2?
Was This Post Helpful? 0
  • +
  • -

#20 travesty  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 68
  • Joined: 04-June 13

Re: Get query string value in 3rd party javascript

Posted 24 June 2013 - 06:43 PM

I'm calling it with "test.js?var=hi", and its able to print "hi" via the 3rd party script.
Was This Post Helpful? 0
  • +
  • -

#21 laytonsdad  Icon User is online

  • Cheese and Sprinkles
  • member icon

Reputation: 449
  • View blog
  • Posts: 1,936
  • Joined: 30-April 10

Re: Get query string value in 3rd party javascript

Posted 24 June 2013 - 06:49 PM

I don't see why it shouldn't work with any name called like that.
Was This Post Helpful? 0
  • +
  • -

#22 travesty  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 68
  • Joined: 04-June 13

Re: Get query string value in 3rd party javascript

Posted 24 June 2013 - 06:52 PM

Me either, this is the wierdest problem I have ever had.
Was This Post Helpful? 0
  • +
  • -

#23 travesty  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 68
  • Joined: 04-June 13

Re: Get query string value in 3rd party javascript

Posted 24 June 2013 - 07:00 PM

Works being named "test_test.js", I tried again by copying it into a new folder and having it name "show_ad.js". Again, it worked without being executed by XAMPP, but when it was t didn't work. I honestly don't know what to do, there is NO reason why it shouldn't work.
Was This Post Helpful? 0
  • +
  • -

#24 travesty  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 68
  • Joined: 04-June 13

Re: Get query string value in 3rd party javascript

Posted 24 June 2013 - 07:10 PM

The problem was I had AdBlock on. Thats why when it was named "show_ad.js" it blocked that cause it thought it was ads (which eventually it will be). When I shut AdBlock off it worked. So I'll just rename it something else.

This post has been edited by travesty: 24 June 2013 - 07:11 PM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2