1.doc ument. Location. href returns the complete URL. Such as: http://www.cftea.com/foo.asp? P = 1
Reference location. Search is from the current URL? String starting
Such as: http://www.51js.com/viewthread.php? Tid = 22720
What is its search? Tid = 22720
With this function, you can easily obtain the parameters following the connection. This function allows the user's parent window to pass parameters to the Child Window.
Eg: Java code
- Function OpenTable (ID ){
- VaR feathers = "status = No, width = pixel PX, Height = 670px, Top = 0px, menubar = No, resizable = No, scrollbars = Yes, toolbar = No, channelmode = No ";
- VaR openwin = Window. Open ("allinfo.html? "+ ID +", "+ new date (). gettime ()," declare ", feathers );
- Openwin. Focus ();
- }
function openTable(id){var feathers="status=no,width=650px,height=670px,top=0px,menubar=no,resizable=no,scrollbars=yes,toolbar=no,channelmode=no";var openWin = window.open("allInfo.html?"+id+","+new Date().getTime(),"declare",feathers);openWin.focus();}
On the allinfo.html page, if we want to obtain the id value, we can obtain the Java code in this way.
- <SCRIPT type = "text/JavaScript">
- VaR Params = Window. Location. Search; // Params :? ID, date
- VaR arr = Params. substring (1). Split (",");
- VaR id = arr [0];
- </SCRIPT>
<script type="text/javascript">var params= window.location.search;//params:?id,datevar arr = params.substring(1).split(",");var id = arr[0];</script>
2.doc ument. Location. search returns the querystring part of the URL, including "?". For example :? P = 1