-1

I have a problem with a javascript function.

Here my html code :

<li><INPUT TYPE="button"  VALUE="ccifi" onClick="ccifi()"></li>

<iframe SRC="" NAME="frame" WIDTH="300" HEIGHT="300" ALIGN="right" frameborder=0></iframe>

and here my javascript function :

<script type="text/javascript">

  function ccifi() {
    document.all.frame.src="http://www.ccfi.asso.fr/blog/";
  }

</script>

And the error is :

Uncaught ReferenceError: ccifi is not defined onclick
Albzi
  • 15,431
  • 6
  • 46
  • 63
  • working for me, but why all of your attributes are in upper case. They should be in lower case. – Mritunjay Jul 03 '14 at 14:09
  • 1
    @Mritunjay I think that was a common practice with HTML4. At the same time, it doesn't matter, because HTML4 and HTML5 is case insensitive: http://stackoverflow.com/questions/4351857/is-html-case-sensitive - XHTML and XML are case sensitive – Ian Jul 03 '14 at 14:12
  • @Pete Doesn't matter where the function is defined - it's called `onclick`, which happens at any point after the page (the JavaScript) is loaded – Ian Jul 03 '14 at 14:13
  • here it is also working – Mrinmoy Majee Jul 03 '14 at 14:13

1 Answers1

-2
<input type="button"  value="ccifi" onClick="ccifi();" />

should do it. you forgot the ";".

Greetz

Thomas
  • 11
  • 2