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

Similar Messages

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

  • 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

  • Invoking external javascript file from xdp source

    Is it possible to invoke an external javascript file from within the xdp source? I know it is possible to embed the javascript in the form.
    If this is possible, would I be correct in assuming that this is also possible from pdf source?
    Basically I am looking to show / hide buttons based on the status associated with a form at a given time in the flow. My understanding of PDFs is that the source cannot be edited once it has been created? If this is the case I was hoping that there could be code embedded that would call on the external file which would return the status of the letter. Based on the response buttons / fragments etc could be shown / hidden as required.
    Feedback required asap please!
    Thanks in advance.

    You cannot call outside of the rendered form. So you have a couple of means to get information into the form. Merge dat aonto the form (in your case you can use a field as a flag and key off of that),or use Web Service call to check the status.
    Hope that helps
    Paul

  • Why does safari display empty page when localhost service are requested using https?

    Why does safari display empty page when localhost service are requested using https and port 37542 (https://localhost:37542/), but displays page properly when regular port is used (https://localhost/).
    Both links return the same json response and work properly in other browsers. Certificate for localhost service was installed to the storage.

    Problem solved.
    I added headers for localhost service response and page displayed normally.

  • Targeting Edge from external javascript file

    Is it possible to target adobe edge build from an external Javascript file? For instance, I click a button outside of the edge animate project and javascript tells Edge animate to "play()". What would that syntax be?

    Yes, it is.  Read this post for some background information and a sample.
    http://forums.adobe.com/message/5289458#5289458
    -Elaine

  • Changing .css property through external Javascript file?

    Hi,
    I'm trying to create all kinds of functions on an external .js file, so I can just call them in Edge multiple times with less coding. The thing is, after importing jQuery and my external Javascript file, some code works, but I get stuck at this part: changing the .css property of a symbol, more specifically, the "font-size" property. My current function is:
    function setFont(textid,fontsize,originalWinWidth){ //textid: symbol's name; fontsize: current font size of this symbol; originalWinWidth: window size at the start of the animation
    console.log("Set Font:");
    //set the original font size
    var originalFontSize = Math.round(originalWinWidth/fontsize);
    console.log("Original Font Size: " + originalFontSize);
    console.log("Text ID: " + textid);
    //set the font size using jquery
    sym.$(textid).css("font-size", originalFontSize);  }
    I get an error at the last line, all other parts of the code works. Any idea what this could be?
    Thanks,
    Rafael Carignato

    Have you tried sending textid to the console.log to make sure you're sending the actual name of the symbol and not a pointer to the symbol itself?
    -Elaine

  • Developing site to use external javascript files for server access. my ain.js file just displays and does not execute. Why?

    My ain.js file is meant to work on and access server files for tracking all visitors to the site I am developing.
    One way to access it, in my plan, is to use index.htm. when I open index.htm it displays correctly and presents a link to ain.js with a query line (?a=zzzzz--e2).
    The entire file is displayed; but not executed.
    Short of building my own server (prior to publishing what I am developing) how do you propose I test what I have written?
    As a retiree, I have limited funds (the purpose of developing a website is meant to coorect that).

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

  • 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

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

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

  • Error while calling an external javascript file

    Hi,
    I have added a javascript file into the public_html folder, i have named it main.js.
    I have a html file in which i am referring to the javascript externally , this too is in my public_html folder. But the HTML page does not seem to be able to invoke the javascript.It does not even enter the method.
    My code is as follows
    html file
    <head>
    <title>untitled1</title>
    <script language="Javascript" src=\"\main.js\" type=\"text/javascript\"></SCRIPT>
    </head>
    <body>
    <form name="test" method="POST" action="test">
    <input type="button" value="submit" name="submit" onclick="analyze_page()">
    </form>
    </body>
    </head>
    main.js
    <script language="Javascript">
    function analyze_page(){
    alert("testing if it works");
    </script>
    (2)
    Secondly, I also have a servlet in a package com.oracle.prod, what is the path I should give in the servlet <SCRIPT> tag so that the javascript is accessible while the page gets rendered

    Hi Kart,
    Try to do:
    <script language="Javascript" src="<c:out value="${pageContext.request.contextPath}"/>main.js" type="text/javascript"></SCRIPT>
    In that way you can access the context path of your application.
    So, another thing that I noted is \" it's unecessary if you are editing directly a jsp/html file.
    Afonso

  • External javascript file not loaded

    Hi I am beginner with jquery ; I am following through with a tutorial;
    I have javascript file called default.aspx.js in the Scripts folder
    /// <reference path="jquery-1.4.1-vsdoc.js" />
    $(function() {
    $("div").click(function() {
    alert('');
    my webform is:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="javascriptweb.WebForm1" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    <script src="Scripts/jquery-2.0.3.min.js" type="text/javascript"></script>
    <script src="Scripts/default.aspx.js" type="text/javascript"></script>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    Div #1
    </div>
    <div>
    Div #2
    </div>
    </form>
    </body>
    </html>
    nothing happens when I click the div;
    i also tried to make the javascript file just call alert upon  documnet ready but it did not work either
    any help will be most appreciated;
    i am using  google chrome 

    Hi,
    Thank you for posting in the MSDN forum.
    I’m afraid that it is not the correct forum for this issue, since this forum is to discuss the VS testing issue.
    Happy to see this issue has been resolved. For further research,
    I suggest that you can consult your issue on ASP.NET forum: http://forums.asp.net/
     for better solution and support.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Use function from external Javascript file

    Hi All,
    Is it possible to use function from other javascript file. If possible then please post some example.
    Shonky

    As Harbs mentioned, you can use doScript().
    Maybe you can do something like this:
    First I created simple function in separate file and exported it JSXBIN
    function myAlert(myString){
        alert(myString);
    Then, I copied contents of that JSXBIN and put it into variable
    var securedFUNCTION = app.doScript("@JSXBIN@ES@[email protected]AffABC40BhAB0AzHjNjZiBjMjFjSjUDAC0EzAEByB");
    or
    var securedFUNC = eval("@JSXBIN@ES@[email protected]AffABC40BhAB0AzHjNjZiBjMjFjSjUDAC0EzAEByB");
    And simply called function
    myAlert('My test String');
    Also, you can use include external script with #include to call JSXBIN, but you need to wrap contents of JSXBIN file into doScript or eval().
    tomaxxi
    http://indisnip.wordpress.com/

  • Error 36 and External Drive File Copy Problem & USB Connections

    In attempting to copy a folder with some 200G+ of files from my iMAC, with OSX 10.6.7, to an external portable WD 1Tb HD, newly formatted to HFS+ (journaled), and connected to the iMAC via a USB cable to the USB port on the iMAC keyboard, I kept getting an error message that Finder could not complete the operation as some data couild not be read or written and transfered, and gave the "Error Code -36". After some searching ont he internet for this error code I came across a host forums discussiong the error code BUT all referred to it being the result of MAC OS hidden "dot-underscore" companioned files being created when the MAC OS X file system copies or moves files to a FAT16 or FAT32 volume. This was not the situaion in my case a both drives were OS X formatted HFS+. Eventually I came across a very vague reference to the error also occuring when the cable connection with the external HD was not solid. I reconnected my external HD and attempted the file transfer again - with the same result. Eventually I decided to plug the external HD into a USB pot on the back of the iMA itself, rather than the keyboard set. Sure enough the error issue disappeared - the transfer successfully completed.
    So my question relates to the "usb connection" challenge with iMAC. the iMAC has only 4 USB ports on the back directly. I did have two desktop external HDs plugged into 2 of these USB ports at the back of the iMAC, as well as a WACOM pad device into the 3rd, and an EPSON 3880 printer into the 4th, and so was forced to employ the ports ont he keyboard for portable HD. So - what's the answer in a situation where the 4 are insufficient and it would appear that the keyboard ports seemed to be unpowered?? Any suggestions?

    It's actually a Time Machine backup drive which is formatted in Mac OS Extended (Journaled). I wish I'd copied the exact error message.
    I believe it was something to the effect of "Error 36: The file could not be copied because some of the date could be be read/written" or something along those lines. Next time it comes up I'll copy it. I have Drive Genius running with DrivePulse, but it doesn't ever seem to start.
    My biggest concern is that this is a sign that the drive is failing. When backing up, it also slows, or stops midway through and just hangs there. Though I haven't done a lot of extensive testing on that because if the drive is failing, I don't want to speed that process up any more.
    To add to the complication, there is a second external drive which Time Machine is also backing up for me. There is one particular file, the Virtual Machine file, I was trying to get off the other external drive and it produced the same problem. That's when I went into Time Machine to try and retrieve the file that way and it did the same thing. The other external drive is making some sounds, but it doesn't sound like a distinct clicking, more like a more pronounced version of the normal constipated hard-drive sound. The Time Machine drive, isn't making any obviously strange sounds at all.
    So, I can't tell whether the drives are failing or if it could actually be that particular file itself causing some strange problems.

Maybe you are looking for