Including javascript file

Can't seem to include an external javascript file. I tried this technique:
http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=98786
but no matter what I do if I include my external javascript file in the head section of the page I get a 404 error, file not found. Also when I hover over it in the Projects view it says "Unrecognized File".
Windows thinks it is a js file. Not sure why Creator does not.
Can someone explain please?
I used the <script src="javascript/myjsfile.js" type="text/javascript"/>
format in the HEAD section of the jsp.

utsukushii,
Yes, the first method works but requires exposing the entire script source to users. Therefore it is not a viable option.
I tried the second method which fails miserably. I don't know why. My guess is that the source of the problem is that the toolkit does not recognize the file as a javascript file. I am not sure why.
It has the "js" extension and the syntax is fine. I can get the content to work when I put it in-line.

Similar Messages

  • How to include javascript file (.js) to pages in portal

    Hi,
    I have been trying to include a javascript file (something.js) to a portal. actually, I want to include it on a html portlet that will be my navigation page.
    I have used the code below to add the js file, but it seems not working
    <script language="JavaScript1.2" src="/javascript/cp_navigation.js">
    </script>
    I have uploaded the js file to the /ora9ias/enterprise/portal/javascript folder (created) in portal server. is there any configuration that I have left out?
    another thing, if I want to include some of the js file to the <head> section, am I possible to do it? and how?
    thanks

    Jerry,
    Where to find this? give the date or the name, please?
    *We're often desperate users that are under pressure to make these Oracle applications WORK for our employers!
    Your help in making us efficient is definitely appreciated!

  • 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.

  • 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 JavaScript in a list instance's form in Visual Studio

    So I know you can use JSLink to include JavaScript files in list definitions in Schema.<g class="gr_ gr_8 gr-alert gr_spell ContextualSpelling ins-del multiReplace" data-gr-id="8" id="8">xml</g> like so:
    <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" JSLink="~site/SiteAssets/Scripts/jquery-1.11.1.min.js" />
    But how can I do this with a list instance that I'm provisioning that's based on the tasks list definition? Is there somewhere I can include JSLink in the instance's Elements.xml?

    If you would have your own custom list definition, you could deploy a custom form for your list instance, and set the JSLink element of the Form. You cannot set it "globally" for the list, only per form.
    If your list instance is based on a built-in list instance (like Tasks in your case) you should set the JSLink property from code. If you would like to deploy the list instance and set the JSLink property from a .wsp package, you should lookup the list form
    and set this property from a feature receiver. If you already created / deployed the list instance, the simplest method is to set the property via PowerShell. See the code samples for PowerShell and C# in this thread.

  • "Error: the xajax Javascript file could not be included. Perhaps the URL is incorrect? URL: /includes/javascript/xajax_js/xajax.js". other posters with a xajax error on this board got the response to go look for developer resources. (i'm not a developer)

    I'm on a mac running 10.6.8, was using Firefox 6.02 when the problem started, i performed a clean install of 7.01, installed the latest Flashplayer, and reinstalled java (the 10.6.5 update file from apple's site).
    I seem able to load video at youtube.com, and was able to load web-based irc chatrooms at ircchat.tv. however, at jamplay.com a paid member site, all of the lessons are flash video, and there's a live video feed chat room that is also flash based, and I am not able to view this content. the video content pops up the error message "Error: the xajax Javascript file could not be included. Perhaps the URL is incorrect?
    URL: /includes/javascript/xajax_js/xajax.js" and the clicking on the "launch chatroom" button does exactly nothing.
    I have contacted the jamplay site team but their recommendations are the steps I have already taken, mentioned above, that did not resolve the issue.
    some links to content on their site visible without being a member:
    http://www.jamplay.com/
    this one has a flash interface that, if things were working, would have a video in the center and members and staff talking abouth that area of the site when you click on one of the title buttons. Now that I am having this problem, nothing is clickable and there's no indication that there should be a video in the center. The error message regarding xajax does not come up at all.
    http://www.jamplay.com/guitar-lessons/beginners/1/527-16-circle-of-fifths
    same thing. video content is missing, xajax error does not appear.
    http://www.jamplay.com/live
    when I load these all content except the video loads on the page. this page does not give me the error at all, just does not load the video
    I can't seem to recreate the actual error without being logged in as a member of the site.
    The apple support team gave me a one-time free suppport ticket to troubleshoot an ethernet issue I was having. Unfortunately, the databases I removed were not deemed either by apple or me to be noteworthy or necessary to retain (all of them were for software I not longer have or use). I don't know which plist file might have been the one I need now. I did reinstall the java and flash items. The only other item that I think it might be is a set of belkin router software that I uninstalled because i'm not using any belkin hardware anymore.
    If someone has any kind of idea I would be most appreciative.

    That's a comment in the file. It has no effect at all.

  • JavaScript help Including JavaScript in a .js File Referenced by the Page

    I need help with JavaScript. I have been doing the Advanced Tutorial, and still don't feel that understand how to make it work.
    The example in "Oracle Database Application Express User's Guide" shows this line:
    <script src="http://myserver.myport/my_images/custom.js" type="text/javascript"></script>
    I understand that "my_images" is hypothetical, but where is the real equivalent to this?
    Is there a working example/tutorial of Including JavaScript?
    <li />Also how does one create AJAX functionality?
    If I want to do something like this http://www.w3schools.com/ajax/ajax_server.asp
    in APEX, where do I place the "time.asp" script?
    <li />Can we assume that the HTML and ASP file are in the same directory?
    Please any assistance with these topics are greatly appreciated.

    Hello,
    >> what is the directory structure you would use for /my_images/custom.js? Where does one load these .js files? where is it in the local machine?
    C:\oracle\product\10.2.0\db\Apache ?
    The documentation only gives you a possible example (and I might agree that it’s not the best one). You should put your external JS files (on the server OS file system) wherever it will be most accessible and maintainable for you. The best place, IMHO, is under the /images/javascript/ directory. The reason is very simple. You can use the alias /i/, which defined in your DAD file, to gain a very simple path to the file. In this case, the loading statement will look similar to the following:
    <script src="/i/javascript/custom.js" type="text/javascript"></script>
    >> Do you mean "Oracle Database PL/SQL Packages/Types and htp packages?"
    I’m assuming you are talking about the on-demand process. This is a regular PL/SQL anonymous block, which will be fired only upon specific request - http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/bldr.htm#BABEAIIE . This is the mechanism for handling the server side of AJAX.
    >>Anythig else available for us to levarage?
    Denes examples site can also be a valuable resource - http://htmldb.oracle.com/pls/otn/f?p=31517:1 .
    Regards,
    Arie.

  • 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 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.

  • How to include HTML file in JSP using HTML elements or Javascript?

    Hi,
    I have around 15000 static html files one for each item which we display each upon invoking an item.The HTML file should be part of a JSP file.
    Please note that the name of the HTML file is determined dynamically
    Placing all the HTML files within the web application does not give us good performance so i would like to put all of them in the webserver.
    I am not able to include the file in the JSP using the jsp:include attribute if i place the HTML files in the webserver ,
    in order to do that i think should use either HTML element or javascript to include the HTML in the JSP.is there any alternative to <Jsp:include>
    Does anyone have an idea how to include the HTML file and take advan tage of webserver?
    Any ideas are appreciated

    What you need to do is simply read the HTML file from the disk and dump it out to the outputstream. It really is that simple.
    There's no reason you need to include all 15000 files in the actual WAR, you can place those files any place handy that is easy for the application to see (in another directory, or accessible from a file server if you have multiple front ends).
    Then, just write a utiility function that takes the output stream (i.e. the 'out' JSP variable), and the file name, read the file, and write it to the stream.
    If you start noticing performance issues, then you can try doing some caching, but truth is your OS should be doing that for you.
    But, truth be told that's the only practical way to do it.
    Another solution would be to use JavaScriipt and XMLHttpRequest (i.e "AJAX") to load the file at the client side, and simply replace a tag with the results.
    That's also pretty trivial to write, any web site talking about AJAX should give you hint there.
    Of course, that won't work for folks who have JavaScript turned off, or some other incompatible browser, whereas the server side solution obviously works everywhere.

  • Trying to include a  javascript file('.js') in a jsp program

    i built an html static page using a .js file.
    calling this javascript file works perfectly.
    but now when copying the code in my jsp page, it doesn't work anymore...
    Does anybody has a clue ? is it a known issue (i don't think so...) ?
    i removed all special characters in the javascript message...
    i placed an alert message to see if the file included is not found, but i never saw it, so i guess the page finds the javascriptfile and try to execute the code...
    this is weird...

    here it is...
    <html>
    <head>
    <title>Intranet de l&#39;IAAI.</title>
    </head>
    <SCRIPT type="text/JavaScript" src="javascript.js">
    alert('fail');
    </SCRIPT>
    <body topmargin="10" bgcolor="#FFFFFF">
    -------------

  • How I can include js (javascript) file in a jsp page?

    Hi,
    I�ve tried to include a js (javascript) file in jsp file but it doesn�t work.
    When I try to use a js function in the browser I always receive an error. Oh, of course, I�m including the correct tag <script src= ...
    What can I do? Does the problem in the WebServer?

    I cheated and put the scripts in another '.jsp' file and had no problem...then put an include b4 the closing 'head' tag, like this:
    <jsp:include page="scrpt.jsp" flush="true" />
    I had to do it this way for debugging using JDeveloper (it doesnt seem to like '.js' files). But when the jsp is on the server I used the following line instead:
    <script language='JavaScript' src='scrpt.js'></script>
    hope this helps.

  • Including JavaScript in a .js File Referenced by the Page Template

    http://download-uk.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/javascript.htm#BCEHEFGF
    Hi trying to implament Patrick's Library
    In the above it gives you the following to put into the template header
    <script src="http://myserver.myport/my_images/custom.js" type="text/javascript"></script>
    I take it
    my server is server1.blahblah.co.uk
    port is 1577 or somthing
    my_images is the default image folder
    so you would get somthing like ...
    <script src"http://server1.blahblah.co.uk.1577/images/jquery_Compressed.js"type="text/javascript"></script>
    <script src"http://server1.blahblah.co.uk.1577/images/ApexLib_Compressed.js"type="text/javascript"></script>
    <script src"http://server1.blahblah.co.uk.1577/images/ApexLib.css"type="text/javascript"></script>
    am I on the right lines?

    Hello,
    If you are using the base APEX images directory for the ApexLib JavaScript files, As Patrick recommends in his installation “How To” document, you can use the alias /i/ for your path. For example:
    <script src="/i/apexlib/jquery_Compressed.js" type="text/javascript"></script> It’s simpler and portable this way.
    CSS files should be loaded using the <link> tag (http://www.w3schools.com/tags/tag_link.asp). In your case, you should use something like this:
    <link rel="stylesheet" href="/i/apexlib/ApexLib.css" type="text/css" /> Don’t skip the ‘=’ sign on your src attribute.
    Regards,
    Arie.

  • Error  while parsing JSF jspx page when including javascript  loops

    Hi All,
    I have a jspx document which contains jsf tags including trinidad tags. I have added a javascript function in the page, which contains a for loop statement, however when I run the page I get an error
    com.sun.facelets.FaceletException: Error Parsing /xAdvisorWeb/bundles/receivetask/manageinbox.jspx: Error Traced[line: 48] The content of elements must consist of well-formed character data or markup.
    at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:234)
    at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104)
    at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:192)
    at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:141)
    at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:93)
    at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:503)
    at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:178)
    at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:995)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:326)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:290)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:213)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:90)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
    Please note that normal javascript code has worked in my jsf page, this problem only occurs only when I add for loop or while loop in the javascript function. Can we not add javascript loops in a jsf page? Is there something else I need to include?
    This is the relevant code snippet :
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:tr="http://myfaces.apache.org/trinidad"
    xmlns:ch="http://www.chordiant.com/jsf"
    xmlns:chrd="http://chordiant.com/jsf/chrd">
    <f:view locale="#{preferLocale.locale}">
    <f:verbatim escape="true">
    <script>
    function validateInput(){
    for(int i=0;i<3;i++)
    alert('Hi');
    return false;
    </script>
    </f:verbatim>
    <tr:commandLink styleClass="ttmBtnCmdLink" onclick="return validateInput();"
    action="#{manageInbox.executeTaskForAssignedWorkItems}">
    <tr:outputText value="#{msgs.execute_btn}"
    styleClass="ttmBtnOutTxt" />
    </tr:commandLink>
    Any help will be much appreciated.
    Thanks in advance,
    Debajyoti

    M-Y wrote:
    replace "<" with "& l t ;"
    remove spaces in "& l t ;" when u paste it in ur code
    in my previous 2 replies i entered it with out spaces and it was getting converted to "<"The forum engine parses HTML entities. So just replace the & by its HTML entity &amp; and it will work: &lt;.
    But no, this is not going to work. JavaScript doesn't recognize HTML entities as operators.
    Follow the suggestion rlubke gave. Or, even better, put all Javascripts in its own .js file and include this file in the HTML head.

  • Deployed application does not contain javascript files

    Hello,
    I am a unexperienced user of the BPM Studio. When I start my application in Oracle BPM my application does not contain the javascript files. It is quite weird, because the path to the .js files is proper - the application works on other computers. I have observed several weird things:
    - when I lookup the application in Firebug, when I try to lookup the source of the .js files, firebug console presents something like this (i deleted most of the html so that it is easy to read):
    <html><head><title>Apache Tomcat/5.5.15 - Error report</title>
    <body>HTTP Status 404 - /workspace//webRoot/webResources/js/jquery-1.4.2.min.js
    Status report message /workspace//webRoot/webResources/js/jquery-1.4.2.min.js
    The requested resource (/workspace//webRoot/webResources/js/jquery-1.4.2.min.js) is not available.
    <h3>Apache Tomcat/5.5.15</h3></body></html>- as i said - the application works just fine on other computers, without having to edit the path to the .js files
    - the application doesn't deploy the application (at least I think it does not) in the OraBPMStudioHome - the application is in the following folder:
    C:\Users\<username>\AppData\Local\VirtualStore\Program Files\OraBPMStudioHome\webapps\workspace\webRoot
    I am using OracleBPM Studio 10gR3, my system is Windows 7 Proffessional 64bit. Could the fact, that my system is 64 bit, cause the error?
    I haven't changed anything in the web.xml, workspace.properties files.
    It looks as if the server didn't include my js files. What may be causing this? I tried to locate the folder where the Tomcat Server deployes the application, and copying the js files where they should be manually, but that didn't work out well - the web application still does not see them.
    By the way, the double // slashes in the path to the .js file are fine on other computers, but is that proper?
    My application uses other scripts, not only jQuery, so changing the link to the jQuery file, won't work.
    I'd be very happy for any solution, thanks in advance!
    Chris Mejka
    Edited by: 789731 on 2010-08-20 01:20

    Nope, that's not the case; all the imports are handled by the <fuego:webResources /> tag, like this:
    <script type="text/javascript" src="<fuego:webResources relativePath='js/jquery-1.4.2.min.js'/>"></script>If that helps, the folder structure, with the .js files is as follows: ../webRoot/webResources/js/ ....
    As I said before - none of my colleagues, who use this application, has this problem, the application runs fine on other computers. The only (or at least that's what I think) difference, is that I use a 64 bit OS... Maybe that's the problem? Or maybe something is wrong in one of my BPM configuration files?
    Edited by: 789731 on 2010-08-20 02:29
    Edited by: 789731 on 2010-08-20 04:42

Maybe you are looking for

  • How to cancel my bt package help please

    after ringing sky and virgin media and being told i was unable to get a package with them i signed up with bt. i signed up for bt-vision, 20 meg net and phone with free weekend calls. i paid the £50 they asked for on the phone and was told i would re

  • Pagesfile size (saved as PDF way) too big!

    I am sure that a PDF shoukd take up lesss room that do mine. Tw A4 pages with mostly text and a few small photos. Gives me a PDF that is nearly 3MB. This is all great if you are on broadband ... but dial-up clients quickly tune out. Have noted that t

  • How to use a config file?

    People, i have a basic question. How to extract the contents from a ".config" file? I have a config file with few sections and few global variables defined. how to extract these data; or how to use this file? a sample .config file, that i have is, #

  • Overlay live video feed with flash animation

    I am using a webcam to allow people see themselves on a screen.  I would like to overlay the video with some flash animation (simple graphics of planes, cars etc.) going across the screen. How do I achieve this?

  • Can I upgrade directly from OS 10.4.11 to OS 10.6.3 on my 2GHz Intel Core Duo?

    <br mcebogus="1">