Javascript not working in traditional or strict pages


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

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    5

    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="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>index</title>
    <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;

    }

    </script>
    _____________________________________________________________

    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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <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" />
    <title>XXXXXXXX</title>
    <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;


    }

    </script>
    THIS DOES NOT WORK

    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.

    http://idesignnewyork.com/2009/idnyhome2009.html - not working

    http://idesignnewyork.com/2009/newindex.html - 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.

    anybody?

  2. #2
    Join Date
    Mar 2007
    Location
    Bangalore, India
    Posts
    247
    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, 02:45 PM
  3. Help with Javascript in forms
    By Keith Sarver in forum Web
    Replies: 0
    Last Post: 12-14-2002, 02: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, 02: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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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