I have a html form for uploading a file, which is as follows:
$uploadhtml = htmlspecialchars(json_encode("<form action='up.php' method='post'
enctype='multipart/form-data'>
<label for='file'>Filename:</label>
<input type='file' name='file' id='file'/>
<br />
<input type='hidden' name='pk' value='".$pk."'>
<input type='hidden' name='username' value='".$USERNAME."'>
<input type='submit' name='submit' value='Submit' onclick= />
</form>"), ENT_QUOTES);
I would like to know if it is possible to call the s etTimeout
function to update a particular layer, like follows:
onclick="setTimeout('updateLayer("text", "ff", "ok"))',1250);"
updateLayer
takes 3 variables as arguments, how would I specify them as parameters within quotes?
像这样:
onclick="setTimeout(function() { updateLayer('text', 'ff', 'ok'); } ),1250);"
You can also backslash the quotes. Note that this only works with " qoutes and not ' quotes in php, but works with both quotes in javascript:
onclick="setTimeout(function() { updateLayer(\"text\", \"your's\", \"ok\"); } ),1250);"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.