Welcome Guest, Not a member yet? Register   Sign In
Help: Calling a Javascript function from within a view
#1

[eluser]Unknown[/eluser]
I'm very new to CI and JS. I'm trying to call a Javascript function from within a view but I can't get this to work.

Code:
<?php foreach ($address as $address_item): ?>

    <scrpt>codeAddress("&lt;?php echo $address_item['Address2'] ?&gt;");</scrpt>
    
&lt;?php endforeach ?&gt;

The JS function is defined inthe header template. Any help would be much appreciated.
#2

[eluser]Aken[/eluser]
What's the problem or error? Have you tried using a Javascript console to look for any errors (such as Firebug for Firefox or the JS console built into Chrome or IE)?
#3

[eluser]bassie[/eluser]
Did a suggestion here for <scrpt> with an i but see that's removed by formum software.
Explains the notation.




Theme © iAndrew 2016 - Forum software by © MyBB