Adding javascript to a URL?

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Apr 2009
Posts: 1
Reputation: amoliski is an unknown quantity at this point 
Solved Threads: 0
amoliski amoliski is offline Offline
Newbie Poster

Adding javascript to a URL?

 
0
  #1
Apr 7th, 2009
My router is stupid, and needs to be rebooted a lot.
I've simplified the process down to
http:192.168.1.1/restart.htm as a shortcut on my desktop.
Once open, there is a JS button with the onClick command RebootDevice()
If I first load the restart page, then type RebootDevice(), it reboots.

Can I add something to the URL that automatically sends the JS command RebootDevice()
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,396
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 170
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: Adding javascript to a URL?

 
0
  #2
Apr 7th, 2009
browse the source of the router page containing the reboot button
the source of javascript function will contain the actual url used to reboot the router
something like ' "/sys/restart2.xgi?submit REBOOT"; ' (dlink)
giving a value for your desktop button
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <!-- one of many possible values -->
  2. http://192.168.1.1/sys/restart2.xgi?submit REBOOT
Last edited by almostbob; Apr 7th, 2009 at 10:57 pm.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,396
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 170
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: Adding javascript to a URL?

 
0
  #3
Apr 8th, 2009
forgot
tooo late to edit last post

in the javascript that performs the reboot
the url is broken into harder to recognize pieces
something similar to
  1. var str = "/sys/restart2.xgi?";
  2. str += exeStr("submit REBOOT");
  3. location.href=str;
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum


Views: 676 | Replies: 2
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC