How to pass and get Parameters between two Pages in Jquery Mobile?

前端 未结 5 392
天命终不由人
天命终不由人 2020-12-06 03:41

I am working on a some demo App to learn things in Jquery Mobile. I have tried a lot of options but not able to get solution on a few things :-

  1. http://jsfiddle
5条回答
  •  情话喂你
    2020-12-06 04:40

    Does this help?

    • http://jsfiddle.net/phillpafford/VXV3R/

    JS

    $('#page2').live('pageshow', function(event, ui) {
        alert('Page 2 - CID: ' + getParameterByName('cid'));
    });
    
    function getParameterByName(name) {
        var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
        return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
    }
    

    HTML

提交回复
热议问题