Hi all, any method to get requested data like php like this dp.php?id=1&data=Wow so how can i get this in java script ? dp.js?id=1&data=Wow Thanks
Again, Google is your friend. This is a common question, and has (as always) been asked before. Have a look here: http://stackoverflow.com/questions/247483/http-get-request-in-javascript
I'm not sure what you need - is it an existing URL? Or a string? If it's an existing URL, you can use the suggestions in the link I showed you If it's a string, you can parse it, split it and do mostly whatever you want, based on standard javascript functionality. If you're using jQuery, there are some very simple functions you can use to get a current URL-parameter, like this: function GetURLParameter(sParam) { var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam) { return sParameterName[1]; } } } Code (markup): which you use like: var urlID = getUrlParameter('id') var urlData = getUrlParameter('data'); Code (markup):
Dear I want to want This <script src="js/name.js?name=PoPSiCLe&platform=dp"></script> and js will create a a iframe <iframe src="//site.com/name.php?name=PoPSiCLe&platform=dp" /> I hope now you can understand
Ohh, I know that bro, but i want location in js file from js/name.js?name=PoPSiCLe&platform=dp bold text
Can you repost what you want to create what? My answer was based on the specs in the above comment. Seems to me it is not what you need?