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.

  $ ('.ui-li-icon li') (function () {var index = $ (this) .index (); text = $ (this) .text ( ); Alert ('index:' + index + 'and text' + text);   

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

  window.location.href = '& lt; profile.html & gt;' + '#' + Path for text;   

To get the parameter () in the profile,

  var text = window.location.hash.substring (1)    

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -