这两个表单提交功能都可单独工作,但如果我同时执行它们则不会.
<form action="" method="post" id="timesheet" >
<input type="submit" name="submit" value="Submit" id="submit" />
</form>
<script>
//first, post results to a Google Spreadsheet
$('#submit').on('click', function(e) {
var jqxhr = $.ajax({
url: url, //google sheet URL
method: "GET",
dataType: "json",
data : $form.serializeArray()
});
});
</script>
<?php
// then email the user their response
if(isset($_POST["submit"])){
// standard PHP mail function (some code left out)
$subject = "WORK TIMESHEET SUBMITTED";
mail($email, $subject, $message, $headers);
}
?>
Run Code Online (Sandbox Code Playgroud) 我正在WYSIWYG广告制作工具中尝试按照以下方式设置第一个字母(Hello中的"H"),内联JS,我只限于此.
<script>
div.innerHTML = unit.greeting; //string value
div.style.color = "gray"; //works
div.firstLetter.style.color = "orange"; // doesnt work
</script>
Run Code Online (Sandbox Code Playgroud)
.
WYSIWYG输出:
<div>
Hello
</div>
Run Code Online (Sandbox Code Playgroud)