我正在使用follwing javascript。但输出是文本。我想在链接中输出。我想在链接中使用javascript vars
<script type="text/JavaScript">
_url = document.location
_picurl = "danny.jpg"
_title = "Your Title Here"
_desc = "Your Description Here"
_fbshare ="http://fbshare.mobie.in/l"
document.write(_fbshare + "?" + "site=" + _url + "&Pic=" + _picurl + "&Title=" + _title + "&Ds=" + _desc)
</script>
我想在链接中使用document.write(_fbshare + "?" + "site=" + _url + "&Pic=" + _picurl + "&Title=" + _title + "&Ds=" + _desc)
但不知道。
分号是不可选。但是,似乎是什么问题呢? –
这是太简单了还是您需要提供更多信息? – Manu
@RobertKoritnik - 是的,[他们是](http://www.ecma-international.org/ecma-262/5.1/#sec-7.9)(尽管使用分号插入被认为是一个坏主意)。 – Quentin