<iframe src= "*******.do?param=****" id= "Leftframe" name= "leftframe" frameborder= "0" ></iframe>
or, use JS to load src:
var params = "pk_id=" +PK_ID;
var frameleftsrc = "<%=path%>/****/****.do" +params;
$ (' #leftFrame '). attr ("src", frameleftsrc);
(for example, here is a single argument, which may actually have multiple parameters.) We continue)
The above two kinds of writing, can implement the IFRAME loading, we may think that no problem, is correct. In fact, the above is really not a big problem, the value of the parameter is not long, attention is the length of the value of the parameter, not the number of parameters. For example, I want to pass a parameter to this IFRAME, the parameter is called PK_ID, the value is a long string of primary key which is returned by the main page or other page to join together the value, at least 3,000 characters above, this time we again use this method to access the problem. Because this URL method is submitted through get, the length of the parameter is limited.
So what do I do with this big data transfer, and there are two things I think about at the moment (everyone has a better offer to talk about, communicate with each other, improve each other):
One, still pass this way , but the value of the parameter is not too long, if not long parameter value can be associated with the query to the long parameter value you want, so that the IFRAME receives this not long parameter value, You'll find a way to get the long parameter value you want in the IFRAME sub-page. (Can be used, but not recommended, because a precondition is required)
second, in the main page using the following methods, to load the IFRAME page can:
Main Page: <iframe src= "About:blank" id= "Leftframe" name= "leftframe" frameborder= "0" >
JS:
var url= "<%=path%>/pubitem/tochoosepubitemleft.do";//action to define form form for IFRAME page
//define form forms
var html1= ' <form id= "Queryform" name= "Queryform" method= "post" target= "_self" action= "' +url+ '" > ' +
' <input type= ' hidden "id=" pk_id "name=" pk_id "value=" ' +pk_id+ ' "/> ' +//pk_id is a value longer than 3000 characters
' </form> ';
document.getElementById (' Leftframe '). ContentWindow.document.write (HTML1); Write the form to the IFRAME
document.getElementById (' Leftframe '). ContentWindow.document.getElementById (' Queryform '). Submit ();// Perform the submission of forms in an IFRAME
wrapping the above method inside a method, and then calling this method when the main page is loaded, will pass the big data on the main page to the IFRAME page.
Resolving the parent class loading IFRAME,SRC parameter too large causes the load to fail