AJAX Forums

Redirect 2

This is a discussion on Redirect 2 within the AJAX Errors forums, part of the Advanced Ajax category; I am using coldfusion. I am sending a form and then after I am done sending the information, I am trying to redirect to another page. I use my ajaxmanager ...

Old 02-05-2008, 11:22 AM   #1 (permalink)
Junior Member
 
Join Date: Feb 2008
Posts: 2
Rep Power: 0 Extolfreak is on a distinguished road
Smile Redirect 2

I am using coldfusion. I am sending a form and then after I am done sending the information, I am trying to redirect to another page. I use my ajaxmanager function to redirect but it doesn't work. It says that the ajaxmanager does not exist. It should exist because I call it in the header on each page. I even tried calling it right before I call the function.
Code:
<script language="javascript" src="../../includes/ajax/ajaxManager.js" type="text/javascript"></script>
Here is the ajaxmanager function
Code:
/*
 *Written by Josh Smith and Tony Trupe. Effects added by Jeff Pamer.
 * args[0] is the action, can be load_page only atm
 * args[1] is the src url, ie the url you have crafted and want to be passed to apache/cf
 * args[2] is the dest element, ie a div named 'main', et.c.
 * args[3] is the effect string, ie an effect name
 */
function ajaxManager()
{
	//just creating an alias to the anonymous arguements being passed in
	var args = ajaxManager.arguments;
	
	//switch over the effect string
	switch (args[3])
	{
		case "fade":
			new Effect.Opacity(args[2],
			{ duration: 0.3, 
			  transition: Effect.Transitions.linear, 
			  from: 1.0, to: 0.1, afterFinish: function(){ ajaxManager(args[0],args[1],args[2],"fadein") }});
			break;
		
		default: 
			//switch over the action
			switch (args[0])
			{
				//if the first arg is 'load_page', then do this stuff
				case "load_page":
					//try to use an activeXObject::XMLHTTP, if that fails, use an XMLHTTPRequest object
					var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
					//if we got some form of and http object...
					if (x)
					{
						//set a call back function for when the readystate changes
						x.onreadystatechange = function()
						{
							//if the readystate is not 4, then display the loading icon
							if(x.readyState != 4)
							{
								//request is not complete yet
								el = document.getElementById(args[2]);
								el.innerHTML = "<img src='/wwwadmin/includes/ajax/images/loading_circle.gif' alt='Loading'>";
							}
							//if the readystate is 4(which is the last state), and the status is 200, then we finished the request
							else 
								if (x.readyState == 4)
									if(x.status == 200)
									{
										//get the destination element, id is in args[2]
										el = document.getElementById(args[2]);
										//and replace the innerHTML with the response text, removing some whitespace
										el.innerHTML = x.responseText.replace(/(^\s+|\s+$)/g,'');
										
										if (args[3] == "fadein")
										{
											new Effect.Opacity(args[2],
											{ duration: 0.5, 
											transition: Effect.Transitions.linear, 
											from: 0.0, to: 1.0 });
										}
									}
								else
								{
									//request failed
									el = document.getElementById(args[2]);
									el.innerHTML = "";
									//an error was encountered
									alert("There was a problem retrieving the XML data:\n"+x.statusText);
								}
						}
						//open the http request object
						x.open("GET", args[1], true);
						//send the http request
						x.send(null);
					}
					break;
			}
	}
}
This is the script for the redirect
Code:
<script type='text/javascript'>ajaxManager('load_page', 'wiki/ajax_wiki_main.cfm?action=wiki_view_topic&proj_id=#selectApp.related_app#&expand=#form.topic_num#', 'wiki-body-inner', 'fade');</script>
Could anyone give me some insight into this.
Extolfreak is offline   Reply With Quote
Old 08-06-2008, 08:05 AM   #2 (permalink)
Junior Member
 
Join Date: Aug 2008
Posts: 1
Rep Power: 0 davidmncc is on a distinguished road
good

OK, we will investigate why PP is short-changing people of the trial period
davidmncc is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Redirect Extolfreak AJAX Errors 0 02-05-2008 11:12 AM


All times are GMT -4. The time now is 07:26 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5
Copyright ©2006 - 2008, AJAXwith.com