Results 1 to 12 of 12

Thread: I need someone who knows something about Javascript

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Security Intelligence TZ Veteran cash_site's Avatar
    Join Date
    Jul 2002
    Location
    Software Paradise
    Posts
    3,385
    yeah, the screen is totaly different in IE compared to FFox... i can see the body now in IE... so, you want the Javascript to make <a tags> inside the body? Can u post a snipet of the XML file?

    Im pretty sure there are built-in FFox or IE code api's etc for XML traversing etc... I think FFox uses the DomDoc ...

    Did u want to hand code the page, surely Dreamweaaver or FrontPage (since ur using IE anyway), could easily interface with XML files...

    --- 0wN3D by 3gG ---

  2. #2
    Senior Member beelzebub's Avatar
    Join Date
    Aug 2004
    Location
    California
    Posts
    223
    Thanks for paying attention cash site, i almost feel like i am talking to myself.

    So I guess I should explain everything, I have been using one script to represent problems shared by 3 scripts on 3 different pages. I was doing this because the scripts all have the same function, to traverse an XML doc and write it to the screen when a their respective HTML page is opened (though each script is different because each xml doc has a different structure).

    Here are the links to the pages that have the different scripts, side by side with the xml doc they display and the script in question used on each page (note: the scripts themselves are inline not accessed from seperate .js files so they can also be found in the HTML/I have privded them in .js files to allow you to view them seperate from the HTML):

    page 1 | xml doc | script
    page 2 | xml doc | script
    page 3 | xml doc | script

    Each of these pages works perfectly in IE and the problems discribed earlier in the thread are now resolved. All of the the problems described ealier were shared with the xml traversal script for each page.

    The current problem is the Mozilla incompatability of this page.

    (Chapter 1: HTML compatibility)
    I have realized that Mozilla is very strict about formatting many elements with one tag. Which is the problem with the navigation menu. In the <TABLE> tag for that menu there resides a BGCOLOR = "######" attribute (it looks like this <TABLE BGCOLOR = "######">......</TABLE>) . I did this to give the entire table including the cells a background. Unfortunetly Mozilla wants each cell to have the BGCOLOR attribute (looks like this <TD BGCOLOR = "######">....</TD>) instead, to say this another way Mozilla wont allow the BGCOLOR of the cells to be set in the <TABLE> tag only in the <TD> tags.

    So I now know how to solve my HTML compatibility issues. They are no longer a problem. The issue I dont know how to solve though is one with javascript .

    (Chapter 2: Javascript/XML compatibility)
    Here is the javascript problem. The scripts would work fine in Mozilla, except that the routine to load an XML file in Mozilla is different from the one in IE. I programed all of the scripts for IE.

    Oh ya here is the routine (it is common to every script, I am omitting the traverse function because it is different for each script):

    var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    function loadXML(xmlFile) {

    xmlDoc.async="false";
    xmlDoc.onreadystatechange=verify;
    xmlDoc.load(xmlFile);
    }

    function verify() {
    if(xmlDoc.readyState!=4)
    return false;
    }

    function traverse(tree) {...}

    function initTraverse(file) {
    loadXML(file);
    var doc=xmlDoc.documentElement;
    traverse(doc);
    }

    initTraverse("events.xml");

    The part I have highlighted in red is the load command that makes these scripts only work for IE. Now, I have read in several place that all I need to do is modify

    var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    function loadXML(xmlFile)

    to say

    var xmlDoc;
    if(window.ActiveXObject){
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");}
    else{ if (document.implementation && document.implementation.createDocument){
    xmlDoc=document.implementation.createDocument("","doc",null);}
    }

    The part I have highlighted in red is the routine that should make the scripts work in Mozilla. Unfortunetly this is not working, though the pages still load in IE. This is my current problem. All I need to know is what to write in order to make this work in both types of browser. I am willing to completely trash everything but the traverse function, if that is what it takes.

    Note: Each page linked to at the top has the updated script, with the Mozilla compatibility routine. And the XML files are the most recent versions.

    Did u want to hand code the page, surely Dreamweaaver or FrontPage (since ur using IE anyway), could easily interface with XML files...
    I pride myself on hand coding everything, I will never use a wysiwyg to make webpages, especially Dreamweaver. I have had so many problems with that piece of trash program in the past that I recommened people throw it out and buy an HTML coding book.

  3. #3
    Senior Member beelzebub's Avatar
    Join Date
    Aug 2004
    Location
    California
    Posts
    223
    OK the solutions to all the problems I had involving Firefox are here:
    http://forums.mozillazine.org/viewto...395758#2395758

    this is the completed site sans flash animations
    http://www.999webmasters.com/users/cferri39//index.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •