Anyone here proficient in Javascript?

Home Archive Serious Business Anyone here proficient in Javascript?
O-Trap's avatar

O-Trap

Chief Shenanigans Officer

14,994 posts
Dec 29, 2013 7:42 PM
I've got a question regarding adding up a variable from several .js pages. These are subscribers, so the number changes.

I wanted to know if it was possible to add all these numbers up using only the .js URL that produces them.

Ex:

http://somewebsite.com/subscriber_number.js?campaign_name=campaign1&var=0
http://somewebsite.com/subscriber_number.js?campaign_name=campaign2&var=0

If you put one in the address bar, it shows the number 153. If you put the other in the address bar, it shows the number 156. As I said, though, these numbers will grow as new people sign up.

Is there a script that will add these together using just the above URLs?


Where's the script wizard, Ender Wiggin, when you need him?
Dec 29, 2013 7:42pm
M

MontyBrunswick

Dec 29, 2013 10:46 PM
I'm not an expert, but a php script would probably be easier.

No, I can't help you... But I'm pretty sure it's way more flexible in that regard.
Dec 29, 2013 10:46pm
O-Trap's avatar

O-Trap

Chief Shenanigans Officer

14,994 posts
Dec 30, 2013 12:42 AM
Ah, I thought that PHP wouldn't work because it's on the server side, and these links have to "fire" before they populate the number.

I'll see if I can piece it together.

Thanks.
Dec 30, 2013 12:42am
justincredible's avatar

justincredible

Nick Mangold

32,056 posts
Dec 30, 2013 10:27 AM
What do you want to do with the new number once you get it?
Dec 30, 2013 10:27am
O-Trap's avatar

O-Trap

Chief Shenanigans Officer

14,994 posts
Dec 30, 2013 1:06 PM
Just display it in a field on the page.

I got impatient last night and paid someone to write something for me, but it populates the number in a lightbox popup. I'd rather just have it on the damn page (which I told him, but he's now not responding).
Dec 30, 2013 1:06pm
justincredible's avatar

justincredible

Nick Mangold

32,056 posts
Dec 30, 2013 1:38 PM
How much did you pay him? Post the code and I might be able to help you get it out of the lightbox and on to the page.
Dec 30, 2013 1:38pm