jquery - How to pass variable value between different html pages in javascript -
I want to give the value of the selected page list item to another page, that means if If I select ABC from the list, then this ABC value passes through the next HTML form and it should open only that profile page. There is no way that I can use this variable in different HTML pages. I want to send my text to my profile.html , Which has the javascript function profile () . I want to pass this text in the function call such as profiles (text); I tried to declare var text above the function call, but still it Not working Let me tell that PLS is another way. You pass the value as a URL fragment In your click function, open the '/profile.html #' + text The URL fragment is found in your profile. Sample code: To navigate to the profile To get the parameter () in the profile,
$ ('.ui-li-icon li') (function () {var index = $ (this) .index (); text = $ (this) .text ( ); Alert ('index:' + index + 'and text' + text);
window.location.href = '& lt; profile.html & gt;' + '#' + Path for text;
var text = window.location.hash.substring (1)
Comments
Post a Comment