Welcome Guest, Not a member yet? Register   Sign In
Non-Javascript Friendly Site
#10

[eluser]Narkboy[/eluser]
[quote author="Coode" date="1290770831"]
In CI 2.0 you can use $this->input->is_ajax_request() instead of isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'[/quote]

I've actually had to extend CI_Session in 2.0 to prevent AJAX calls from updating the session ID, so now I can just use
Code:
if ( IS_AJAX ) {
    ...
}
Which makes life very easy. I didn't realise that 2.0 had anything in the Input class about ajax - I'll check it out; it might mean I don't need the added constant defined!

Thanks!


Messages In This Thread
Non-Javascript Friendly Site - by El Forum - 11-20-2010, 03:10 PM
Non-Javascript Friendly Site - by El Forum - 11-20-2010, 03:46 PM
Non-Javascript Friendly Site - by El Forum - 11-20-2010, 03:46 PM
Non-Javascript Friendly Site - by El Forum - 11-20-2010, 03:57 PM
Non-Javascript Friendly Site - by El Forum - 11-20-2010, 04:03 PM
Non-Javascript Friendly Site - by El Forum - 11-20-2010, 04:16 PM
Non-Javascript Friendly Site - by El Forum - 11-20-2010, 09:22 PM
Non-Javascript Friendly Site - by El Forum - 11-21-2010, 03:55 AM
Non-Javascript Friendly Site - by El Forum - 11-25-2010, 11:27 PM
Non-Javascript Friendly Site - by El Forum - 11-26-2010, 03:50 AM
Non-Javascript Friendly Site - by El Forum - 11-26-2010, 06:36 AM
Non-Javascript Friendly Site - by El Forum - 04-19-2011, 09:22 AM
Non-Javascript Friendly Site - by El Forum - 04-19-2011, 01:28 PM
Non-Javascript Friendly Site - by El Forum - 04-19-2011, 04:48 PM
Non-Javascript Friendly Site - by El Forum - 04-19-2011, 05:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB