Javascript not working in Codeigniter
I'm having trouble with document.write in codeigniter.
Here is my test code:
<script type="text/javascript">
document.write("Hello World!");
</script>
In a standard html or php document it works fine and writes Hello World! on the browser screen. So that eliminates browser oddities and doctypes etc and开发者_StackOverflow javascript is definitely not disabled.
However, if I put the same script in a vanilla codeigniter view, nothing appears on the screen.
Anyone got a clue what's wrong?
Always giving the asker the benefit of the doubt, I installed a fresh copy of CI live with your code, one in <head>
, one in <body>
, and had absolutely no problem.
I'm afraid you aren't giving enough details or have an unrelated error. Maybe you turned javascript off.
精彩评论