Jump to content

Need Help: PHP page loading issue


madThumbs

Recommended Posts

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::confused::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

Link to comment
https://forums.phpfreaks.com/topic/137957-need-help-php-page-loading-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.