开发者

Sharing dialogArguments between urls

开发者 https://www.devze.com 2023-02-05 13:05 出处:网络
I have a modal dialog box that opens up a window with dialogArguments set. The page then redirects from xxx/yyy/ to xxx/yyy/1 and javascript throws:

I have a modal dialog box that opens up a window with dialogArguments set.

The page then redirects from xxx/yyy/ to xxx/yyy/1 and javascript throws:

Uncaught ReferenceError: dialogArguments is not defined

How do I pass this be开发者_如何学Pythontween the two pages?


You can save in session or cookie.

Or... could to pass the arguments in url and get it from new page.

Example:

xxx/yyy/ redirects xxx/yyy/1?arg1=hello&arg2=world

You can get arguments using:

(http://www.netlobo.com/url_query_string_javascript.html)

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return null;
  else
    return results[1];
}

gup(arg1) returns hello

0

精彩评论

暂无评论...
验证码 换一张
取 消