本文介绍了什么是嵌入式JavaScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 我说inline javascript意味着javascript

  2. 我的程序员意味着inline javascript是1行的javascript,并且像

    不带 src 的脚本标签(即直接在HTML文档)被称为内联脚本。



    一个 onclick =... attrib ute被称为内联事件处理程序。


    Me and my programmer has 2 different views for what "Inline JavaScript" is.

    1. I said inline javascript means javascript placed directly in the HTML file, without in a .JS file.

    2. My programmer means inline javascript is javascript on 1 line, and like <button onclick="alert('test')">

    I give him right in, that inline javascript also is "onclick='alert(...)" because it again is like my solutin #1, all javascript loaded in HTML and not in JS.

    Who's right?

    We have a HTML file, and there is <script>....</script> javascript in the bottom, that is inline javascript, right?

    解决方案

    A script tag without a src (ie. with code directly in the HTML document) is referred to as an inline script.

    An onclick="..." attribute is called an inline event handler.

    这篇关于什么是嵌入式JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 19:06
查看更多