Well, I was actually looking for a more specific answer, however I did
find out through trial and error that it works sort of like this:

$.ajax({ success: function(response){
          if(response.indexOf('<script>') != -1){
               eval($(response).html());
          }
     }
})

There's no need to strip out <script> tags, it already does that.

Thanks, let me know if this isn't right.

Brian.

On Nov 6, 10:51 am, George <[EMAIL PROTECTED]> wrote:
> My guess you could use Eval statement...
>
> George.
>
> On Nov 6, 10:07 am, briandichiara <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I would like my AJAX Request to function like this:
>
> > if empty, all good, proceed.
> > if scripts, not good, execute the script.
> > if no scripts, but something in response, alert the text (some kind of
> > error).
>
> > Reason I want this is when the user tries to execute an action that
> > requires them to be logged in and they are not or their session has
> > timed out, I would like to output <script> to the AJAX Request page so
> > the jQuery function can execute it and redirect the user to the login
> > form. Is there something built in to handle scripts received by an
> > AJAX Request?
>
> > Thanks.

Reply via email to