View Single Post
  #1 (permalink)  
Old 11-12-2007, 08:20 PM
krnl krnl is offline
WebProWorld Member
 
Join Date: Jan 2006
Location: USA
Posts: 47
krnl RepRank 0
Arrow AJAX and javascript calling javascript

I am using (or attempting to use, anyway) an AJAX solution for use in posting client-side information to update database values on my website. I have the AJAX portion working and calling a page to process the database update, but I'm having problems getting the values from the client-side javascript to use in my local AJAX javascript function.

For instance, I run website www.aaa.com, and within my site, there is a call to a javascript at an external website, bbb.com which I use to display certain information within my site.

So, I call bbb.com's javascript as such:

Code:
<script type="text/javascript"
    src="http://www.bbb.com/jsfunction.js?a=30&key=deadbeef"></script>
Now, I want to take the return value (an integer ranging from 0-1000) from the above javascript call and place use it in a variable within my local javascript. Can this be done?

Something like:
Code:
<script type="text/javascript">
var key = "<?= $item_key ?>";
var xyz = document.write("<script type='text/javascript' 
   src='http://www.bbb.com/jsfunction.js?a=30&key="'+key+'"><\/script>');

ajaxFunction('update', xyz);
</script>
Any pointers you all can give would be greatly appreciated.

Thanks.
__________________
Rick - Linux Tutorials for Beginners
allin-enterprises.com | VaGunForum.net | all-in-general.com | MagliteSales.com |

Last edited by krnl; 11-12-2007 at 08:46 PM.
Reply With Quote