madThumbs Posted December 22, 2008 Share Posted December 22, 2008 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.:confused: OK Here is the story: As you can see the blowing code, it will only work if I put a line:" alert("thank"); " otherwise, the function foodo (url) seems never been call, or say there is no text field been created. Any idea why? -------------------------------------------- index page: // I include a js file to index page: <script type="text/javascript" src="https://#*$!.com/my.js"></script> -------------------------------------------- my.js 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://#*$!.com/createText.php?param=0'+ str); alert("thank"); } -------------------------------------------- createText.php page: // Process passing values and creat a text file. This isn't a big file. Big OR, if there is another way to execute a php file via javascript not AJAX? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/137953-need-help-javascript-loading-issue/ Share on other sites More sharing options...
madThumbs Posted December 22, 2008 Author Share Posted December 22, 2008 solved Quote Link to comment https://forums.phpfreaks.com/topic/137953-need-help-javascript-loading-issue/#findComment-721090 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.