how to use jquery in amember pro

88 Views Asked by At

i want to add script for redirect purpose. in

/amember/library/Am/Paysystem/Abstract.php in thanksaction function

i am using following code

$response->addScript()
                ->setScript(<<<CUT
jQuery(function($){

window.location.href ="http://www.google.com/";
});
CUT
);

But i am getting following error:

Fatal error: Call to undefined method Am_Mvc_Response::addScript() in    /amemberroot/library/Am/Paysystem/Abstract.php 

do anyone know what could be the issue?
thanks in advance.

1

There are 1 best solutions below

0
On

Am_Mvc_Response class has not such methods as addScript. aMember has open source code and you always can check class declarations. To do redirect just use the following code:

Am_Mvc_Response::redirectLocation("http://www.google.com/");