Welcome Guest, Not a member yet? Register   Sign In
Conditionally loading javascript in views
#4

[eluser]InsiteFX[/eluser]
You can try this!
Remove + from script tags.

Code:
// This conditional statement does not seem to work and the javascript
// shows up in the html all the time causing errors

// since these datatables dont exist
<?php if ($load_state): ?>
    <+script type="text/javascript">
        $('#datatable_state').dataTable().fnClearTable();
    <+/script>
&lt;?php endif ?&gt;
                
&lt;?php if ($load_county): ?&gt;
    <+script type="text/javascript">
        $('#datatable_county').dataTable().fnClearTable();
    <+/script>
&lt;?php endif ?&gt;

InsiteFX


Messages In This Thread
Conditionally loading javascript in views - by El Forum - 12-14-2010, 08:34 AM
Conditionally loading javascript in views - by El Forum - 12-14-2010, 09:53 AM
Conditionally loading javascript in views - by El Forum - 12-14-2010, 10:12 AM
Conditionally loading javascript in views - by El Forum - 12-14-2010, 10:51 PM
Conditionally loading javascript in views - by El Forum - 12-15-2010, 11:28 AM
Conditionally loading javascript in views - by El Forum - 12-27-2010, 12:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB