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/137957-need-help-php-page-loading-issue/ Share on other sites More sharing options...
Philip Posted December 23, 2008 Share Posted December 23, 2008 I'm not quite sure what you're trying to do here - but it looks like execute a PHP filled javascript file after the page has loaded. Is that correct? Quote Link to comment https://forums.phpfreaks.com/topic/137957-need-help-php-page-loading-issue/#findComment-721945 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.