Hi Guys, I am facing a really odd issue here: my scripe will only work if I put a alert() at the end of the function.???
OK Here is the story:
As you can see the blowing code, it will only work if I put a line:” [COLOR=”Red”]alert(“thank”);
Any idea why?
index page:
[code=html]
// I include a js file to index page:
<script type=”text/javascript” src=”https://xxx.com/my.js”></script>
my.js
[code=html]
function foodo (url) {
// Create new JS element
var jsel = document.createElement(‘SCRIPT’);
jsel.type = ‘text/javascript’;
jsel.src = url;
document.body.appendChild (jsel);
return true;
}
function Caller(formID){
var elem = document.getElementById(formID).elements;
var str = ”;
for(var i = 0; i < elem.length; i++)
{
str += “&”+elem[i].name + “=”+elem[i].value;
}
foodo (‘http://xxx.com/createText.php?param=0’+ str);
alert(“thank”);
}
createText.php page:
[code=php]
// Process passing values and creat a text file. This isn’t a big file.