Note that there are some explanatory texts on larger screens.

plurals
  1. POincluding js file and using function inside jquery ready scope
    primarykey
    data
    text
    <p>i have js file named defined_tools.js iside folder js .</p> <p>i wrote simple function in it </p> <pre><code>function xxxx(){ alert("rt"); } </code></pre> <p>now in my index page i included the file by this line </p> <pre><code>&lt;script type="text/javascript" src="js/defined_tools.js"&gt;&lt;/script&gt; </code></pre> <p>and in the head scope i write this code to execute <strong>xxxx()</strong> function </p> <pre><code>&lt;script type="text/javascript" language="javascript"&gt; $(document).ready(function(e) { xxxx(); }); &lt;/script&gt; </code></pre> <p>i got error in chrome console</p> <p><strong>Uncaught ReferenceError: xxxx is not defined</strong> </p> <p>MY FULL PAGE</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Main Site&lt;/title&gt; &lt;link rel="stylesheet" type="text/css" href="css/defaults.css"/&gt; &lt;link rel="stylesheet" type="text/css" href="css/devtool.css"/&gt; &lt;!-- Jquery Library --&gt; &lt;script type="text/javascript" src="js/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/jquery-ui-1.10.3.custom.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/defined_tools.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/core_osx.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" language="javascript"&gt; $(document).ready(function(e) { xxxx(); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;!-- Tool Dev --&gt; &lt;div id="tooldev" class="ToolSize"&gt; &lt;div id="new_panel" class="ToolCommands"&gt;&lt;/div&gt; &lt;div id="new_text" class="ToolCommands"&gt;&lt;/div&gt; &lt;div id="new_image" class="ToolCommands"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div id="workspace" class="DefaultWorkspace"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload