PDA

View Full Version : how to access callback function from email


Darren
04-09-2008, 06:05 PM
First, came here a while back with Ajax questions and so far everything is going great. My intranet site seems to be working perfect. Thanks for the assistance to date.

Well, I now have a feature that I'm not quite sure how to add. Let me begin by saying that I think my site is following a pretty standard methodology... user submits to the server using a javascript function ajaxSubmit(), server side application processes the request and sends back an xml response, client side javascript function processCallBack() parses the xml and performs various actions (such as display new page, alter contents on current page, fill form fields, display pop up, whatever).

I have a new need--the ability to send the user an email and have a link in the email to jump to a particular page and begin an action. I'm not sure how to construct the link in the email. The following things don't work:

www,mysite,com/cgi/application.cgi?parms=many

no surprises here. the xml response just displays in the browser window, it doesn't get processed through the function processCallBack().

javascript:ajaxSubmit('www,mysite,com/cgi?parms=many')

again, not a surprise. doesn't run because we're not in a page that has loaded my javascript file. just returns the error "object required".

Sadly, the only solution I can think of is to add an html ability to my application (I'd much rather be able to just re-use the xml response).

Is there an elegant way to accomplish what I'm trying to do here?

Thanks in advance,
Darren

A1ien51
04-09-2008, 10:16 PM
Your link would have to point to the page you want the user to go to. Add a qs parameter to it. Read what value you want to load from the qs and make the Ajax call.

Eric

Darren
04-09-2008, 11:29 PM
I think I did what you just described. I made a tiny static page with an onload event called ajaxRedirect(). That function strips off the query_string and submits it using my ajax functions. the url now looks like this

www,mysite,com/redirect.htm?/cgi/application.cgi&parm1=abc&parm2=123&parm3=etc

Is this basically what you meant?

btw... is there an elegant way to do it without the static page?

Darren

A1ien51
04-10-2008, 03:29 AM
I would not be using JavaScript, I would just have the serverside code output what ever you want.


Eric