Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Is it possible to catch parameters passed onto HTML via Javascript?


  • Please log in to reply
2 replies to this topic

#1 Shadow Slash

Shadow Slash

  • Members
  • 25 posts
  • OFFLINE
  •  
  • Local time:12:34 AM

Posted 11 April 2010 - 07:15 AM

Is it possible to catch parameters passed onto HTML via Javascript?
What i mean to say is for example, in PHP it would be like the example below:

www.somesite.org/mypage.php?value=content

Notice ?value=content is appended to the URL of the PHP file. I get it that this is done with the GET method in a form. Now my question is, how do I replicate the same event using javascript? I've seen some websites have the following:

www.somesite.org/mypage.html?somevalue=somecontent

I just can't remember w/c sites those are but I'm sure they are existent. How do I do the HTML bit? My hosting doesn't support PHP that's why I'm asking this. I DONT WANT TO CHANGE MY HOSTING. They offer good service and PHP is their only downside.

If my problem above is not solvable using JavaScript, please give me the alternatives! Than you so much!

Edited by Shadow Slash, 11 April 2010 - 07:17 AM.


BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:10:34 AM

Posted 11 April 2010 - 09:09 AM

So instead of just using the built-in functionality of HTML, you want to read the contents of the form via javascript and submit it that way? A URL is just a string, and strings can be easily manipulated using javascript. Reading a form via javascript is trivial; there are probably tens of thousands of tutorials that can show you how. Loading a page using javascript is also trivial, and again, there are tens of thousands of tutorials to show you how.

#3 Shadow Slash

Shadow Slash
  • Topic Starter

  • Members
  • 25 posts
  • OFFLINE
  •  
  • Local time:12:34 AM

Posted 12 April 2010 - 08:33 AM

A URL is just a string, and strings can be easily manipulated using javascript.

OMG! I just had an epiphany! By using data from window.location.href, I can play with the text it contains! Thank you for giving me an idea!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users