html - Javascript file placed in external file not executing -
i made webpage inputs user's feedback using form. on successful submit display thank message on same page, i'm using javascript.
the code executes when put javascript on same page. however, when tried separate script onto file (in test webserver), stopped executing.
can please help?
relevant codes mentioned below: head element
<head> <meta charset="utf-8" /> <!-- proper rendering , touch zooming in mobile devices --> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="shortcut icon" type="image/x-icon" href="images/logo.ico" /> <title><?= htmlspecialchars($title) ?></title> <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" /> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link rel="stylesheet" type="text/css" href="css/style.css" /> <script type="text/javascript" src="../javascript/submit-logic.js"></script> </head> first 2-3 lines of javascript function:
$(function () { $('form').submit(function (e) { e.preventdefault(); detailed code (html, css, javascript) can found in codepen (this working expected) : http://codepen.io/abbor123/pen/ygwvxg
javascript folder placed outside public folder , has 755 permission.
edit 1:
file tree screenshot:
console error screenshot: (submit-logic.js name of javascript file. url mentioned on hovering on link is: /javascript/submit-logic.js:1 )
the javascript code page available @ following url: https://gist.github.com/abor123/3193eb399c3f973be453ae9a8fcc0ce5
move javascript folder public_html. quentin commented, server isn't set serve files outside public_html.


Comments
Post a Comment