Jump to content

Need Help: Javascript 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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.