Ben burada küçük bir sorun var!
after i submit my form, based on php response i want to execute another javascript or ajax function!
Bu benim şeklidir:
<form id="uploadForm" onsubmit="ytVideoApp.prepareSyndicatedUpload(
this.videoTitle.value,
this.videoDescription.value,
this.videoCategory.value,
this.videoTags.value);
return false;">
Enter video title:<br />
<input size="50" name="videoTitle" type="text" /><br />
Enter video description:<br />
<textarea cols="50" name="videoDescription"></textarea><br />
<select style="display:none" name="videoCategory">
<option style="display:none" value="Music">Music</option>
</select>
Enter some tags to describe your video
<em>(separated by spaces)</em>:<br />
<input name="videoTags" type="text" size="50" value="video" /><br />
<input id="butok" type="submit" value="go" >
</form>
Run This javascript fonksiyonu göndermek üzerinde
ytVideoApp.prepareSyndicatedUpload = function(videoTitle, videoDescription, videoCategory, videoTags) {
var filePath = 'operations.php';
var params = 'operation=makesomething' +
'&videoTitle=' + videoTitle +
'&videoDescription=' + videoDescription +
'&videoCategory=' + videoCategory +
'&videoTags=' + videoTags;
ytVideoApp.sendRequest(filePath, params, ytVideoApp.SYNDICATED_UPLOAD_DIV);
}
nerede ytVideoApp.sendRequest olduğunu:
ytVideoApp.sendRequest = function(filePath, params, resultDivName) {
if (window.XMLHttpRequest) {
var xmlhr = new XMLHttpRequest();
} else {
var xmlhr = new ActiveXObject('MSXML2.XMLHTTP.3.0');
}
xmlhr.open('POST', filePath);
xmlhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhr.onreadystatechange = function() {
var resultDiv = document.getElementById(resultDivName);
if (xmlhr.readyState == 1) {
resultDiv.innerHTML = '<b>Loading...</b>';
} else if (xmlhr.readyState == 4 && xmlhr.status == 200) {
if (xmlhr.responseText) {
resultDiv.innerHTML = xmlhr.responseText;
}
} else if (xmlhr.readyState == 4) {
alert('Invalid response received - Status: ' + xmlhr.status);
}
}
xmlhr.send(params);
}
I tried with: echo "<script>function();</script>"
not working
print "alert('something');"; not working
Herhangi 1 bana yardımcı olabilir?
teşekkürler!