How do you guy grab a value from this javascript

Hi,
I’m wondering if anyone know how to grab values of the results from this javascript snippet. I want to store the value into database.


<script language="Javascript" src="http://gd.geobytes.com/gd?after=-1&variables=GeobytesCountry,GeobytesCity">
</script>
<script language="Javascript">
	document.write("<p>Welcome to visitors from "+sGeobytesCity+", "+sGeobytesCountry);
</script>

Thanks,

If you want to get values from JavaScript in to a database you could make an AJAX request to a server side script that subsequently stores the data in a database.

You wouldn’t be able to do this with JavaScript alone though, you will also need a server side language (like .NET, PHP, Ruby, etc.) to connect to a DB and store the data.

Thanks for quick response,

Can you please more specific. I use PHP and MySql. I want to grab the displayed results and store into a table.

Essentially there are 2 ways you can do this, an easier way would be to create an iframe that’s hidden in the DOM that sends through the values or as John said use Ajax, if your not strong with JavaScript the iframe technique is a good way to go but Ajax would be cleaner and more efficient as it can be re-used where as an iframe needs to be manipulated every single time you make a request.

Thanks. I get a picture. Look like there’s a thorny road ahead though.