我正在开发JavaScript,并且只想在条件被验证时插入脚本。Javascript:<script src = jquery ...只有在条件为真的情况下
例如:
var a = exampleVariable;
if (a == conditionIwant) {
// append to head:
<script src="http://code.jquery.com/jquery-1.5.js"> </ script>
}; //or something like this
我如何可以插入的jquery.js只有一个条件是真的吗?
你有机会到另一种技术 - PHP,ASP等,这是真正的东西,如果可能,你应该做的服务器端。 – 2011-04-28 13:49:29