Use the jquery implementation to open a new window as post

  • 2020-03-30 02:25:15
  • OfStack

The network has this function, is to pure JS implementation. However, in the project, I found that this function was not compatible with Firefox, so I overwrote this method.
//Default new window configuration
var windowDefaultConfig = new Object; 
windowDefaultConfig['directories'] = 'no'; 
windowDefaultConfig['location'] = 'no'; 
windowDefaultConfig['menubar'] = 'no'; 
windowDefaultConfig['resizable'] = 'yes'; 
windowDefaultConfig['scrollbars'] = 'yes'; 
windowDefaultConfig['status'] = 'no'; 
windowDefaultConfig['toolbar'] = 'no'; 

function jQueryOpenPostWindow(url,args,name,windowParam){ 

//Create a form object
var _form = $("<form></form>",{ 

//Add hidden fields to the form
for(var i in args){ 

//Clone the window parameter object
var windowConfig = clone(windowDefaultConfig); 

//Configuration window
for(var i in windowParam){ 
windowConfig[i] = windowParam[i]; 

//Window configuration string
var windowConfigStr = ""; 

for(var i in windowConfig){ 
windowConfigStr += i+"="+windowConfig[i]+","; 

//Binding commit triggers events

//Trigger commit event
//Form to delete

Write it down for later use.

Related articles: