error passing a very large string as Javascript function argument

M

maverick1611

Hi,
I'm trying to call a javascript function from my aspx page. the
javascrpt function call looks like this
<a
href="javascript:initializepage('<%Replace(DataBinder.Eval(Container.DataItem,"BIGXMLFILE1"),"""","")%>','<%Replace(DataBinder.Eval(Container.DataItem,"BIGXMLFILE2"),"""","")%>')">Click
This Link</a>
I am basically passing the content of 2 large XML files to the
javascript function. When the XML files are of a reasonable size 1 kb -
2 kb it works fine but as the size increases the javascript function
just doesnt d anything ..
is there a good way to get around this problem

thanks,
mav
 
L

Lee

maverick1611 said:
Hi,
I'm trying to call a javascript function from my aspx page. the
javascrpt function call looks like this
<a
href="javascript:initializepage('<%Replace(DataBinder.Eval(Container.DataItem,"BIGXMLFILE1"),"""","")%>','<%Replace(DataBinder.Eval(Container.DataItem,"BIGXMLFILE2"),"""","")%>')">Click
This Link</a>
I am basically passing the content of 2 large XML files to the
javascript function. When the XML files are of a reasonable size 1 kb -
2 kb it works fine but as the size increases the javascript function
just doesnt d anything ..
is there a good way to get around this problem

Don't abuse the javascript:pseudo-protocol in this way.

<script type="text/javascript">
function initializepage() {
//dosomethingwithreallylongstring
}
</script>


<href="somepage.html" onclick="initializepage();return false">This Link</a>


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top