DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Javascript not working in traditional or strict pages

  1. #1
    Join Date
    Aug 2008

    Javascript not working in traditional or strict pages

    I had to copy a piece of java code into the head of a new xhtml doc. The original page and the first couple of lines of code are the original code below. The page holds an .swf that calls a java function. (THIS WORKS)

    <html xmlns="" xml:lang="en" lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script language="javascript">AC_FL_RunContent = 0;</script>
    <script src="AC_RunActiveContent.js" language="javascript"></script>

    <script language="javascript">
    function scrolling(){
    document.body.scrollTop = 750;



    I made a new page in Dreamweaver /the default is xhtml transitional

    and copied the code so the page now looks like this

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="description" content="Your description goes here" />
    <meta name="keywords" content="your,keywords,goes,here" />
    <meta name="author" content="Your Name" />
    <link rel="stylesheet" type="text/css" href="/2009/idnynew.css" title="idny1.css" media="screen,projection" />
    <script language="javascript">AC_FL_RunContent = 0;</script>
    <script src="../AC_RunActiveContent.js" language="javascript"></script>

    <script language="javascript">
    function scrolling(){
    document.body.scrollTop = 750;



    The java function does not work in the xhtml traditional or strict xhtml for that matter.

    Can someone tell me why and what I have to change in the java to make it work in xhtml trans or strict?

    Is it healthy to leave it alone and put the page up the way it is deleting the first line of code?

    Below are two links to the same looking page. - not working - working

    To see what I mean when the page loads click the blue JOBS / INTERNS button the working page will move down like an anchor to the Y 750 position

    look at the source files for both pages, so far no one could answer this

    this question was sitting in the Adobe forum for days unanswered so I thought it would be answered here.


  2. #2
    Join Date
    Mar 2007
    Bangalore, India
    First of all, they are not Java functions. They are JavaScript functions.
    Then, try changing <script language="javascript"> to <script type="text/javascript">. In XHTML, <script> tag doesn't have an attribute called language, only type.

Similar Threads

  1. Replies: 5
    Last Post: 05-06-2006, 10:22 PM
  2. Replies: 2
    Last Post: 01-09-2006, 03:45 PM
  3. Help with Javascript in forms
    By Keith Sarver in forum Web
    Replies: 0
    Last Post: 12-14-2002, 03:18 PM
  4. Javascript not working on Mac, works on PC
    By Jane L in forum Architecture and Design
    Replies: 1
    Last Post: 06-29-2002, 01:50 AM
  5. Sample Sites.
    By Murray Foxcroft in forum Web
    Replies: 5
    Last Post: 11-02-2000, 03:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center