Debt Consolidation - Sport Betting Bonuses - Find jobs - Justin Gatlin Doping - Sport Betting Systems

PDA

View Full Version : Javascript Copy Page Contents


AT-XE
May 7th 2009, 7:02 am
Hey there DPers,
I was struggling with this for days (I'm new to JavaScript) so, I was thinking if I could ask your help on this topic. I basically want to create a function in javascript that will return the contents of a document on the web with the "url" parameter so that I can then call it with the document.write function like on the example below:

var currentTime = new Date()
var sec = currentTime.getTime()/1000
var cont = ajaxinclude('http://www.domain.com/timezone.php?time='+sec)
document.write(cont)

Thank you,
-AT-XE

JavaScriptBank.com
May 9th 2009, 6:27 pm
you can not use AJAX for fetching data from different domains

camjohnson95
May 9th 2009, 10:27 pm
This can be done easily server-side, but I'm not sure of any way that it can be done client side, most browsers won't allow it.

AT-XE
May 30th 2009, 2:27 pm
you can not use AJAX for fetching data from different domains

I am trying to fetch data from my domain, on which the javascript will also be run.

This can be done easily server-side, but I'm not sure of any way that it can be done client side, most browsers won't allow it.

Basically i want to put information inside a server-side script that is gathered by client side (e.x: the allowance of cookies, screen resolution etc).