How to include external javascript file in an html

hello
i've an html file placed in apache/webapps/test folder this html file includes an external javascript file placed at same level
i'm includind the file as
<script src="file1.js"></script>but the file does not gets included
but when the sam folder "test" is paste outside apache the html file including the external file runs properly.
Thank You

flounder wrote:
cotton.m wrote:
What's really pathetic is that this is your third cross post on this same stupid off topic topic.
You are really a dumb f&#117;ck you know that?If they knew that they were a dumb f&#117;ck then they wouldn't be a dumb f&#117;ck!That's a logical and reasonable conclusion. Therefore I very much doubt that the OP is capable of it.
Hmmm this is interesting. It now shows the entity escapes rather than their values when you quote.

Similar Messages

  • How to include external JavaScript files

    Hello All,
    i'm wondering haow can i include externel JavaScrip files, there is an clip-example with a function in the same JSP file
    but not how to include a file?
    <body>
    <script language='JavaScript' src="menu/menu.js'></script>
    If some one has a clip i would appreciate.
    Thanks
    Gino

    <script src="resources/myscript.js"></script>
    I did this exact thing in my jsp but it did not work, nothing popped up.
    When I tried replacing it with:
    <script language="JavaScript" type="text/javascript"><![CDATA[
    function postMessage(message) {
    alert(message);
    ]]></script>
    It worked. Can someone tell me why? Can't i refer to javascript files this way?

  • How to  include external javascript and css resources to a jsf?

    I need to include external css and javascript files to my jsf page. Using the code below does not work because all the styles on the css page are ignored and the functions within the js files are not executed.
    <link rel="stylesheet" type="text/css" href="/resources/styles/style.css" />
    <script language="JavaScript" src="/resources/javascript/util.js"></script>When I try to execute any js function within a script tag on a jsf page I get an object expected error.
    I googled about my problem and found this piece of code for importing styles for an external css.
    <style type="text/css">
    @import url("/resources/styles/style.css");
    </style>How could I add an external javascript file to my jsf?

    Used the relative urls in my first post as well as these, and both were not working.
    <link rel="stylesheet" type="text/css" href="./resources/styles/style.css" />
    <script language="JavaScript" src="./resources/javascript/util.js"></script>The ./ tells that the external file can be found by starting at the current directory and working down the path to the specified file. This is my directory structure. Index.jsf is the file that references the external js and css files.
    -Webcontent
    |_index.jsf
    |_resources
    |__styles
    | |__style.css
    |__javascript
    |__util.js
    Either way I still can't reference the files that I need. Calling a javascript function results in an object expected error, and the styles are ignored.
    If I include the js file directly in the jsf then I can get it to work. I don't want to do this because I have created a handful of seperate js files, and do not want to include all of them in one page. I am using myfaces and tomahawk if that helps.

  • How to include external .js file into .ear file using NetBean 5.5.1?

    is it possible to include external .js file into .ear file using NetBean 5.5.1? if not, then where should I placed the external .js file and how to write the src="xxx" element? (that is , how to write the path of "xxx"?)
    I am using JBOSS 4.2.2 GA as server
    thx!!

    Even this is also not possible because, the code in that package is developed by DWR and i am just adding it to my lib folder and importing the respective classes. In the same manner i need to include the *.js* file in the JSP.It took me about 3 minutes reading through the [DWR Getting Started|http://getahead.org/dwr/getstarted] page to learn that you don't have to do any of that. Perhaps you should read that page?

  • How to include external Javascript script files?

    We have had a number of students run into problems with our LMS.  The support staff at the LMS say that it is due to the version of Java (JRE) that the student is running on their device.  The LMS says that they only support Java JRE version 1.6 and 1.7.
    I have found some Javascript on the Oracle site that checks the client JRE version, but it requires that the student brings in one of their Javascript script libraries:
    <script src="https://www.java.com/js/deployJava.js"></script>
    <script>
        if (deployJava.versionCheck('1.6+')) {
            alert('OK to Continue');
        } else {
            alert('This course will only work Java version 1.6 and up');
    </script>
    I am familiar with the Javascript windows in various Captivate items.  I am using Captivate version 7.
    My question is how can i include the current deployJava.js script lib from https://www.java.com/js/  (and possibly some other script libs) with all courses that I publish from now on?  Is there some template file that I can update so that this script lib is automatically included in all courses that I publish using SCORM 2004 ver. 4?
    Thanks

    <script src="resources/myscript.js"></script>
    I did this exact thing in my jsp but it did not work, nothing popped up.
    When I tried replacing it with:
    <script language="JavaScript" type="text/javascript"><![CDATA[
    function postMessage(message) {
    alert(message);
    ]]></script>
    It worked. Can someone tell me why? Can't i refer to javascript files this way?

  • How to include external js file in jsp page??

    Hiii...i am new bie in jdeveloper....
    and trying to add external js file to a jsp page...
    the adress of javascript file is [ Web Content/WEB-INF/jsp/script/test.js ]
    adress of jsp page is [ Web Content/WEB-INF/jsp/WelcomePage.jsp ]
    so what source address of js file i have to give in jsp page.....

    Hi,
    In order for the jsp page to get the js file, it has to be accessible via an http request, and files in WEB-INF aren't. You'll have to put the js file in a different location or provide another way to get the file, such as via a servlet request.
    This is the way to do it. I don't see a use case in that adding a JS file to WEB-IF provids any benefit as the sources could be looked up from the browser anyway. So if your intention is to secure the JS sources, this wont work.
    Frank

  • Including external Javascript file in JSP- not working on Mozilla Firefox

    I have a JSP page which includes javascript file as below:
    <script type="text/javascript" src="https://siteAddress/scripts/myJsFile.js"></script>
    myJsFile.js has a method testFireFox()
    There is a link on JSP which that calls this method.
    <a href="#" onClick="testFireFox()">Some Text...</a>
    As soon as i click on the link, nothing happens and this error appears on console:
    Refrence Error: testFirefox() is not definedI tried giving the path for JS file in various ways but it did not help.
    Note: This works absolutely fine in Internet Explorer.
    I have not added Javascript to document.ready or onLoad event. It is simply been referred in <Head>
    tag any pointers pls..

    This forum is intended for user support, not for web development issues.
    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The contributors over there are more knowledgeable about web page development issues with Firefox.
    http://forums.mozillazine.org/viewforum.php?f=25
    You'll need to register and login to be able to post in that forum.

  • How to include External .JS File in .aspx and .ascx page???

    This is my Code::
    .aspx Code:::
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Calculator_Using_UserControl_And_Js.aspx.cs" Inherits="Calculator_Using_UserControl_And_Js" %>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
     <title></title>
      <script src="/JS/JavaScript.js" type="text/javascript"></script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div align="center"> 
            <p style="color:brown">Welcome to User Control Page</p> 
            A:<asp:TextBox ID="tbA" runat="server"></asp:TextBox>
            B:<asp:TextBox ID="tbB" runat="server"></asp:TextBox>
            <asp:Button ID="btnAdd" runat="server" Text="ADD" OnClientClick="return fnAdd()"/>
            <asp:Button ID="btnSub" runat="server" Text="SUB" OnClientClick="return fnSub()" />
        </div>
        </form>
    </body>
    </html>
    .JS code
    function fnAdd() {
        var v1 = document.getElementById(tbA).value;
        var v2 = document.getElementById(tbB).value;
        var res = parseInt(v1) + parseInt(v2);
        alert(res);
        return false;
    function fnSub() 
        var A = document.getElementById(tbA).value;
        var B = document.getElementById(tbB).value;
        var res = parseInt(A) - parseInt(B);
        alert(res);
        return false;
    I 've tried with the following methods but no use...
    <script type="text/javascript" src="<%= ResolveUrl ("~/Scripts/MyScriptFile.js") %>"></script>
    <script type="text/javascript" src="../JScript.js"></script>
    <script src="javascript.js" ></script>
    Thanks & Regards RAJENDRAN M

    You can write JS function as follows:
    function fnAdd(numberA,numberB,totalT) {
    var v1 = document.getElementById(numberA).value;
    var v2 = document.getElementById(numberB).value;
    var total = parseInt(v1) + parseInt(v2);
    document.getElementById(totalT).value = total;
    return false;
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    <script src="javascript.js"></script>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    A: <asp:TextBox ID="numberA" runat="server"></asp:TextBox><br />
    B: <asp:TextBox ID="numberB" runat="server"></asp:TextBox><br />
    T: <asp:TextBox ID="totalT" runat="server"></asp:TextBox><br />
    <asp:Button ID="btnAdd" runat="server" Text="Add" OnClientClick="return fnAdd('numberA','numberB','totalT');" />
    </div>
    </form>
    </body>
    </html>
    And you can do the same for fnSub

  • Call External Javascript file in Custom Visual WebPart

     Hi..
     How to call external javascript file in Custom Visual WebPart in sharepoint 2010
    Ravindranath

    Hello,
    Download that script and save in layout folder or within a site. Then use below script tag in webpart:
    <SharePoint:ScriptLink ID="ScriptLink2" Name="location/jquery-1.5.min.js" runat="server" OnDemand="false" Localizable="false" />
    http://stackoverflow.com/questions/5068663/how-to-call-an-external-javascript-file-from-a-webpart
    http://stackoverflow.com/questions/5243821/external-javascript-file-in-sharepoint-web-part
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to include external files in JSP

    hi,
    How to include external files like image or javascript in to jsp pages.
    I am using MVC frame work. So i have to use request dispatcher. While calling the pages trough dispatcher the external files are missing from the output. Also am using tomcat as server,web.xml(deployment descriptor ) is also configured.
    regards
    sree

    When you use the request dispatcher, the relative path for all your ressources becomes the relative path of your calling serlvet and not the JSP/servlet that you call. Make sure to use the full relative path such as:
    /PATH_TO_YOUR_DIRECTORY/myRessource.ext
    NOT
    SOME_DIRECTORY/myRessource.ext
    Jeff

  • How can I include a javaScript files from within jsf component

    Is there any way using which I can include javascript files from my jsf component. Because otherwise I have to write all the javascript commands using writer.write which is very tedious rather than this I just want to include the javascript file which contains all the functions required. Also I want that this file should be included only once irrespective of the number of components included.
    Thanx in advance

    This doesn't depend on JSF. You need to include a script tag, like:
    <script src="/path/script.js"
    language="JavaScript" type="text/javascript"></script>
    If you want to include this only once, make a file included into every page, into which you can put other resources to be included along with this script.
    HTH,
    rs.

  • Jspx and external javascript file (display empty page ?!?!)

    I have created a JSPX file...
    Now I want to add a javascript control to verify that only numbers are pressed from keyboard..
    This is a simple javascript function:
    function isNumberKey(evt)
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
    return false;
    return true;
    When I add a function directly to jspx I get error in phase of compile of the page...
    So I tryed to write an external javascript file with function above...
    In My jspx page i have put <script src="functions.js"></script> the tag has a reference to external javascript file...
    When I run the page I get "blank" page.. (it's like that all html code is a comment)..
    If I remove the script tag the page will display correctly...
    Is there any example how to include an external javascript file inside jspx?
    this is a piece of jspx:
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1250"/>
    <title></title>
    <link href="css/oracle.css" rel="stylesheet" media="screen"/>
    <script src="functions.js" type="text/javascript"></script>
    </head>
    ..

    Hi,
    you should not add
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1250"/>
    <title></title>
    <link href="css/oracle.css" rel="stylesheet" media="screen"/>
    <script src="functions.js" type="text/javascript"></script>
    </head>
    to f:view. There are JavaScript equivalents to this. Alternatively use
    <f:verbatim>
    <script src="functions.js" type="text/javascript"></script>
    </f:verbatim>
    I assume you use JDeveloper 10.1.3 because in JDeveloper 11 there are other options
    Frank

  • How to include external style sheet

    Hi !!
    Can any one explain how to include external style sheet.

    Anil,
    Simply include the css file as I demonstrated in my last post and then reference one the css classes by name in the "styleClass" attribute of the component. So, if the css file that have included in my JSP file (as demonstrated in the prev post) contains a class like:
    .spicyPink {
    color:#FF1CAE;
    font-weight:bold;
    Then I would simply reference this class in the component as folows:
    <af:outputText value="Pretty In Pink" styleClass="spicyPink"/>
    However, you can also add styling to a component inline and accomplish the same task:
    <af:outputText value="Pretty In Pink" inlineStyle="color:#FF1CAE;
    font-weight:bold;"/>
    The thing to remember is that other than the use of styleClass and inlineStyle, referencing and including css in your JSP/JSPX pages is really no different that used in an HTML page.
    Here is reference to help you along:
    http://www.w3.org/TR/REC-CSS1#containment-in-html
    --RiC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to include assigned .as files in MXMLC ant task ?

    When i use mxmlc ant task, i found that
    the tag <include-sources/> doesn't support !
    ( described by http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7a63.html )
    neither SDK version 3.x nor 4.x
    Are they lying?!
    How to include assigned .as files ?
    Thank you !

    My understanding is that mxmlc will use all available resources in the source path, as needed. Instead of giving it individual resources to include, you simply need to give it the source-path that contains those resources. This is different from a library project, which may need to include individual classes that are never used in that library.

  • How to include a dynamic file

    Hi,
    The following syntax does not work:
    <%@ include file="htmls/mydocs/<%=dynamicFileName%>.htm" %>
    could you tell me how to include a dynamic file?
    thanks,
    peterzhu

    The include directive <%@ include ... does not work with dynamic file names, because it is evaluated at compile time.
    You have to use the include standard action <jsp:include page=... This is executed during runtime, and hence a dynamic file name can be used.

Maybe you are looking for