I have a function called loadXMLDoc which takes text from the url parameter and sets it inside the parameter name of another page that has the same span name. im trying to use onload to make it into one line by using onload instead of having it in 2 lines.
<span id="span number1" onload="loadXMLDoc('www.url','span number1')"></span>
I have a function called loadXMLDoc which takes text from the url parameter and sets it inside the parameter name of another page that has the same span name. im trying to use onload to make it into one line by using onload instead of having it in 2 lines.
<span id="span number1" onload="loadXMLDoc('www.url.','span number1')"></span>
<span id="span number1"></span>
<script> loadXMLDoc("www.url.","span number1");</script>
Share
Improve this question
asked Feb 12, 2015 at 15:01
Safi NaseenSafi Naseen
1231 gold badge2 silver badges4 bronze badges
1 Answer
Reset to default 3That's not possible. onload
works only on external resources (images, frames, ...) and the body itself.
Depending on your page structure you could add onload="loadXMLDoc('www.url.','span number1')"
to the <body>
tag. Otherwise your second example looks correct and should also work.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745169969a4614865.html
评论列表(0条)