i hava index.html page.in this page i give a href url to TM.htm page.And also i want to send parameter to TM.htm and render it in this page from index.html
in index.html page when i click link in URL it shows TM.htm?a=7 and it works but in TM.htm page i want to get a parameter with this code
window.location.search.substring(x..)but instead of it give TM.htm?a=7 it gives index.html .what should i do
this is index.html
<li><a href='TM.htm?a="+marker.ID </a></li>");<li><a href='TM.htm?a="+marker.ID </a></li>");<li><a href='TM.htm?a="+marker.ID </a></li>");and in TM.htm in page load i want to get urlwith this code window.location.search but it not give TM.html url it gives index.html urlhow can i get TM.htm url in TM.htm?
edited area is below
this is my index.html page :index.html in here there is a href TM.htm?a=ID...
in index.html when i click link(such as "Patatesli Kek Tarifi" link) it goes to TM.htm and in TM.htm page i want to get query string in URLso in TM.htm pageon load event i write
$(window).load () {alert(window.location);....
but although i write this in TM.htm this give me index.html page URL but i want to TM.htm page URL
- Based on the fact that it does not give you the name of the file you expected, I think you placed this piece of code in the wrong file.cutsoy– cutsoy2013-05-07 20:02:15 +00:00CommentedMay 7, 2013 at 20:02
- @TimvanElsloo - no his problem is he is caling window.location.[etc] which is getting the QS for the current page not the hrefPaul Sullivan– Paul Sullivan2013-05-07 20:03:57 +00:00CommentedMay 7, 2013 at 20:03
- @PaulSullivan I'm not really sure I understand this. He clicks on the href, which then "redirects" him to TM.htm, and then wants to now the
a-param, right?cutsoy– cutsoy2013-05-07 20:11:08 +00:00CommentedMay 7, 2013 at 20:11 - actually @TimvanElsloo I think you are right - his question is a bit unclear. OP can you make this a bit clearer pleasePaul Sullivan– Paul Sullivan2013-05-07 20:21:26 +00:00CommentedMay 7, 2013 at 20:21
- @TimvanElsloo thank you very much...i edited question ...you can see edited code in edited area..and i preapered demo with link... in index.html there is a href TM.htm page and in TM.htm page i want to URL .i am using window.location in TM.htm page but it gives index.html url not TM.htm page urluser1688401– user16884012013-05-07 21:11:01 +00:00CommentedMay 7, 2013 at 21:11
1 Answer1
I believe that you are encountering this error due to non codepage 1252 characters in your document i.e. Turkish / odd character encoding.
Create two blank new documents in notepad or textpad (index.html and tm.htm) and make sure it uses ONLY 1252 or standard character encoding. add a single link from index.html to tm.htm and include your script. If it fires as you expect then your problem is the character encoding of your text file.
I believe the odd characters are causing some hidden bug in the browsers them selves.
I tried moving your script, making it a<body onload="funct()">...</body>, updating jquery and firebug always showed the old pages scripts after a click from the index page to the tm.htm page. Could only get the script to fire by clicking refresh on tm.htm.
Regards,
9 Comments
Explore related questions
See similar questions with these tags.