Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

PeterValencicMar 13 2009 — edited Mar 13 2009
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>
..
..
..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2009
Added on Mar 13 2009
2 comments
418 views