reset password
Author Message
Urvashi
Posts: 34
Posted 15:04 May 21, 2009 |

Hello,

I have written a javascrpt function with the ajax request which looks like this

function getArchiveEntry(blogid, year)
{
    var ajaxRequest = new AjaxRequest("<c:url value='/AjaxArchiveMonth.html'/>");
    ajaxRequest.setQueryString("blogid=" + blogid + "&year=" + year);
    ajaxRequest.sendRequest();
}

 

and then later on the same jsp, i have called the function like this in a display:column tag

<display:table name="ArchiveEntry" uid="archive" requestURI="viewBlog.html">

<display:column style="text-align: left; white-space:nowrap; width: 100%;" >
<a href="javascript:getArchiveEntry(${blogEntry.blog.id},${archive[0]});">${archive[0]} - (${archive[1] })</a>

<div id="get_Archive_Entry">
</div>
</display:column>

When i run csns, on the blog page , i get a link for year...when i click on it, nothing happens, i do not get any data...i have put break points on the controller and on the jsp but it seems that the javascript function getArchiveEntry is not being called...Any suggestion on what might be the problem?

I have been working on this since morning and cant find the problem ..

 

 

cysun
Posts: 2935
Posted 15:16 May 21, 2009 |

In Firefox, open Tools -> Error Console, then use Firefox to try the page again. If it's a JavaScript problem, an error message will be shown in the Error Console.

Urvashi
Posts: 34
Posted 15:37 May 21, 2009 |
cysun wrote:

In Firefox, open Tools -> Error Console, then use Firefox to try the page again. If it's a JavaScript problem, an error message will be shown in the Error Console.

The error i am gettin through the error console is

getArchiveEntry is not defined

Any suggestions ?

cysun
Posts: 2935
Posted 15:48 May 21, 2009 |
Urvashi wrote:
cysun wrote:

In Firefox, open Tools -> Error Console, then use Firefox to try the page again. If it's a JavaScript problem, an error message will be shown in the Error Console.

The error i am gettin through the error console is

getArchiveEntry is not defined

Any suggestions ?

Make sure the JavaScript code is enclosed in the script tag, i.e. <script type="text/javascript">...</script>. Check for spelling errors. Use the W3C validator to validate the generated HTML page - it will find syntax errors that caused by typos.

Last edited by cysun at 15:48 May 21, 2009.
Urvashi
Posts: 34
Posted 16:27 May 21, 2009 |

Hello Professor,

It still doesn't work....did all the spell check and script tag is there, i am missing something , dont know what ...will you be in office tomorrow?

cysun
Posts: 2935
Posted 16:28 May 21, 2009 |
Urvashi wrote:

Hello Professor,

It still doesn't work....did all the spell check and script tag is there, i am missing something , dont know what ...will you be in office tomorrow?

Email the JSP to me and I'll have a look.

abhishek_sharma
Posts: 79
Posted 19:46 May 21, 2009 |

Hi

My ajax function is throwing an error when I tried in Morzilla

I am not understanding what this error is, please help

Thanx

 

 

 

Attachments:
cysun
Posts: 2935
Posted 20:24 May 21, 2009 |
abhishek_sharma wrote:

Hi

My ajax function is throwing an error when I tried in Morzilla

I am not understanding what this error is, please help

Thanx

taconite-client.js is part of the Taconite library. If the problem is with the library itself, I don't know how to fix it. With that said, since the message says something about errorHandler, my guess is that there's some problem in the response. and fixing that problem may fix this, too.

liangxu
Posts: 15
Posted 09:49 May 22, 2009 |

Hi,

Initially I seemed to have the same problem, i.e.,  nothing happend withe clicking the fold. 

Later I found that it was caused by a dead loop in the ajax controller while generating the response .

You may put a breakpoint in the beginning of your ajax controller and try some debugging.

Hope it helps.