CodeIgniter Forums
dont out javascript code - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: dont out javascript code (/showthread.php?tid=17855)



dont out javascript code - El Forum - 04-17-2009

[eluser]ClaudioX[/eluser]
Hi all!

I'm start loading one simple page. By $.ajax i load from controller one view where i have some javascript code, the problem is: this code does not appear on the final page, apparently it is not returned.

I need some care with a view? a buffer, anything?

The code of this innerHtml is something like:

Code:
<table>
<tr>
  <td>Telephone</td>
  <td>&lt;?=form_input($Tel)?&gt;</td>
</tr>
<table>
[removed]
$("#Name").mask("(99)9999-9999");
[removed]

The table is returned ok, but the script not.

Thanks for the help!!


dont out javascript code - El Forum - 04-17-2009

[eluser]ClaudioX[/eluser]
Sorry about the script tag, i really forget..

Do testing here, the alert is called, but in Firefox i still dont see the code... becouse that, i dont know if the mask is there or not..

Does anyone have some idea?


dont out javascript code - El Forum - 04-18-2009

[eluser]slowgary[/eluser]
The view does not scrub your markup, but it's possible that the $ from your ajax call is being interpreted as a PHP variable. Can you post your PHP?


dont out javascript code - El Forum - 04-18-2009

[eluser]ClaudioX[/eluser]
Hi slowgary, and really thanks for the reply.

PHP from where are you asking?

I will put much of the route to genarate de mask, hope its help you to helpme.

function ajax call the html form
Code:
edited

tel.form
Code:
edite
Code:
edited

I try it in the initial page, and works ok, now i think the matter is the jquery plugin works on ready() stage.. and its dont work on $.load function...

Advance my sincere thanks

I dont know if i making it on the best the way, but what im doing is one way to generate form masks.