
以下是引用片段: <script> if(top.location==self.location) { top.location="index.htm?"+self.location; } </script> |
注意,index.htm是外套網(wǎng)頁地址,接下來要做的就是,怎樣讓外套網(wǎng)頁自動添加這部分內(nèi)容,我們要在外套網(wǎng)頁中解析網(wǎng)頁地址,找到參數(shù),然后將框架src參數(shù)指向該參數(shù)就行了,java代碼如下:
以下是引用片段: <script> document.write('<iframe id="mid" name="mid" width="100%" height="100%" frameborder="0" scrolling="auto"') var n=self.location.href.indexOf("?")//查看是否包含參數(shù) if(n>0)//存在參數(shù) { //指向參數(shù) document.write(" src="+self.location.href.substr(n+1)) } document.write('></iframe>') </script> |
您發(fā)布的評論即表示同意遵守以下條款:
一、不得利用本站危害國家安全、泄露國家秘密,不得侵犯國家、社會、集體和公民的合法權(quán)益;
二、不得發(fā)布國家法律、法規(guī)明令禁止的內(nèi)容;互相尊重,對自己在本站的言論和行為負責(zé);
三、本站對您所發(fā)布內(nèi)容擁有處置權(quán)。