howto send clinet request to server in SVG [Archive] - XML Elves

howto send clinet request to server in SVG

Anonymous
08-03-2005, 10:04 AM
Hi There,

I have to find a way to communicate with server from svg file. I have to send two whole arrays of values to server so server can insert them into database. I thought if I can transfer this array to xml file, and render a dsp sripct (dsp is a server page sripting language) object, I can insert into database.
I have tried using two different ways:

js_Vol is a javascript array which needs to be sent to server
the database here is an object oriented and custom made.


function send(){
alert(js_Vol);
vol = '{'+js_Vol+'}';
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
alert("I am HERE");
xmlDoc.async="false";
xmlDoc.load("writeNewStrikeVol.xml?AnchorVols="+vol);
}


this does not work, I do not get alert: "I am HERE" upon execution.
I also tried
var xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

instead of

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

which also doesn't work :(

=>
Other way I thought of trying with getURL() and parseXML() which also does not work.. I don't get alert("past getURL)


function send(){
alert(js_Vol);
vol = '{'+js_VolY+'}';
getURL("writeNewStrikeVol.xml?AnchorVols="+vol, testFunction);
//getURL("writeNewStrikeVol.xml", testFunction);
alert("past getURL");

}

function testFunction(obj){
var string = '';
if(obj.success){
string = obj.content;
}
alert(string);
var vol = parseXML(obj.content,svgDocument);

var volId=vol.firstChild.getAttribute("id");
alert(svgDocument);

var volData=vol.firstChild.firstChild.getData();
alert("ID = "+volId+" and the tag contents = \""+volData+"\"");

}


and if I just say getURL("writeNewStrikeVol.xml", testFunction);
I can get past the alert, and all other alerts are shown as blank = null except svgDocument.



my xml file is:

<?xml version='1.0'?>
<newvol id="1000">
<!-- DSP

Task.setParameter&#40;"aVols",22&#41;;

test.render&#40;&#41;;

-->
<!-- DSPOBJECT name = setVolNew
sql = update NewVols set AnchorVols=aVol;
-->
<!-- DSPOBJECT name = test
aStrikes
aVols
-->
</newvol>



Thank you very much for any suggestion.

Hacc
08-10-2005, 12:42 AM
Hi
Is your SVG Document embedded in another document?
The functions that you call, is it part of your SVG document?
Have you tried browserEval?

Regards,

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum