[英]How To Use Variable In Javascript Code Ex: src=“htp://www.url.com/file.php?id=[3434]”
I'm running a wordpress multisite network where I give users an options page with different settings to make their page unique. 我正在运行一个wordpress多站点网络,在该网络中,我为用户提供具有不同设置的选项页,以使其页面唯一。
I would like to implement a GetResponse optin form on their page. 我想在他们的页面上实现GetResponse optin表单。
In the options page I have a field where they can put in their GetResponse FormID - which is usually 6 numbers (422125). 在选项页面中,我有一个字段,他们可以在其中输入GetResponse FormID-通常为6个数字(422125)。
The getresponse form looks like this: getresponse表单如下所示:
<script type="text/javascript" src="http://app.getresponse.com/view_webform.js?wid=422125&mg_param1=1"></script>
I need to be able to change 422125 to whatever id they set within their options page. 我需要能够将422125更改为他们在选项页面中设置的ID。
I already have the php code written that calls the id from the options page, but I can't figure out how to set it within the javascript. 我已经写了从选项页调用id的php代码,但是我不知道如何在javascript中进行设置。
Any help would be greatly appreciated... Thank you for your time! 任何帮助将不胜感激...谢谢您的时间!
在PHP页面上,您可以执行以下操作,它将回显$form_id
作为URL的wid
参数。
<script type="text/javascript" src="http://app.getresponse.com/view_webform.js?wid=<?php echo $form_id ?>&mg_param1=1"></script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.