Results 1 to 4 of 4
Thread: invoking javascript on in jsp
- 12-12-2008, 07:21 AM #1
Member
- Join Date
- Jul 2008
- Location
- india
- Posts
- 35
- Rep Power
- 0
invoking javascript on in jsp
hi!!
i have a jsp file and i have to invoke javascript function in jsp file..actually i have a xml file and i had parsed that xml in this function ..i had to invoke value based on the key ..i mean i want that function to return certain value ..following is the function in script tag
function parseXML()
{
try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
catch(e)
{
try //Firefox, Mozilla, Opera, etc.
{
xmlDoc=document.implementation.createDocument(""," ",null);
}
catch(e)
{
alert(e.message);
return;
}
}
xmlDoc.async=false;
xmlDoc.load("mytext1.xml");
var x=xmlDoc.documentElement.childNodes;
for (var i=0;i<x.length;i++)
{
if (x[i].nodeType==1)
{
//Process only element (nodeType 1) nodes
document.write(x[i].nodeName + ": ");
document.write("value="+xmlDoc.getElementsByTagNam e(x[i].nodeName)[0].childNodes[0].nodeValue);
var y=xmlDoc.getElementsByTagName(x[i].nodeName)[0].childNodes[0].nodeValue;
document.write("y="+y);
}
}
return(y);
}
........i am invoking this function like this
<tr>
<td nowrap width=200>
<p class="formHeader"><a href="parseXML()">Abone</a> </p>
</td>
</tr>
- 12-12-2008, 08:40 AM #2
Where is the problem .. ??
dont worry newbie, we got you covered.
- 12-12-2008, 09:35 AM #3
Member
- Join Date
- Jul 2008
- Location
- india
- Posts
- 35
- Rep Power
- 0
i am not getting expected output..i want to get value based on key as a return value from the function ...
- 12-12-2008, 04:54 PM #4
Similar Threads
-
Invoking Servlet from SWT application
By wolve634 in forum SWT / JFaceReplies: 1Last Post: 03-30-2009, 11:35 AM -
Invoking a MIDlet from a webbrowser
By islamfunny in forum CLDC and MIDPReplies: 3Last Post: 10-08-2008, 10:43 AM -
Object Reflection: Invoking methods
By Java Tip in forum java.langReplies: 0Last Post: 04-23-2008, 08:14 PM -
Invoking superclass methods... how?
By rhobincu in forum New To JavaReplies: 7Last Post: 08-09-2007, 03:10 PM -
invoking method and output questions
By bluekswing in forum New To JavaReplies: 1Last Post: 08-06-2007, 06:36 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks