如何用JAVASCRIPT獲取ASP中的變量的值
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
<% i="abcd" %> <script language="javascript"> alert( "<%=i%>"); </script> ========================= javascript取得文件路徑的方法: <script language="javascript"> <% filePath=server.MapPath("book.xml") filePath=replace(filePath,"\","\\") %> xmlPath="<%=filePath%>"; document.write(xmlPath); </script> *注意:javascript要獲取asp中變量的值的時(shí)候,一定要用雙引號(hào)把整個(gè)asp代碼塊(包括<%%>標(biāo)簽)包含起來(lái),不然無(wú)效。 該文章在 2024/5/28 11:31:28 編輯過(guò) |
關(guān)鍵字查詢(xún)
相關(guān)文章
正在查詢(xún)... |