Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Rich Text Editor loading problems in IE

Expand Messages
  • Dav Glass
    Rob -- I don t see why it wouldn t, please post a link to a broken page so we can see it happen.. Thanks Dav -- Dav Glass davglass@gmail.com blog.davglass.com
    Message 1 of 5 , Jan 1, 2009
    • 0 Attachment
      Rob --

      I don't see why it wouldn't, please post a link to a broken page so we can see it happen..

      Thanks
      Dav

      --
      Dav Glass
      davglass@...
      blog.davglass.com


      + Windows: n. - The most successful computer virus, ever. +
      + A computer without a Microsoft operating system is like a dog
         without bricks tied to its head +
      + A Microsoft Certified Systems Engineer is to computing what a
        McDonalds Certified Food Specialist is to fine cuisine  +


      On Thu, Jan 1, 2009 at 5:56 PM, Rob Booth <rob.o.booth@...> wrote:

      Why is it that I can only get the Rich Text Editor to load in IE when
      I place this script block in my HTML?

      <script>
      function displayEditor()
      {
      //The Editor config
      var myConfig = {
      height: '300px',
      width: '475px',
      dompath: true,
      focusAtStart: true,
      handleSubmit: true,
      animate: true
      };

      //Now let's load the Editor
      var myEditor = new YAHOO.widget.Editor('message', myConfig);
      myEditor._defaultToolbar.titlebar = 'News Editor';
      myEditor.render();
      }

      YAHOO.util.Event.onDOMReady(displayEditor);
      })();

      Instead of including that script in an external file, as I'd prefer
      and as works with Firefox?

      <script type="application/x-javascript" language="JavaScript"
      src="/scripts/forms/newsForm.js"></script>

      I prefer to have all of my scripts load from external files and use
      onDOMReady type events to be kicked off, as opposed to being included
      inline in my HTML. Is there something I'm missing to make my code
      work in IE from an externally loaded file?

      Thanks,
      Rob


    • cjavajim
      ... The following worked in Firefox 2.0.0.20 and IE6: Rich Text Editor
      Message 2 of 5 , Jan 1, 2009
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "Rob Booth" <rob.o.booth@...>
        wrote:
        >
        > Why is it that I can only get the Rich Text Editor to load in IE when
        > I place this script block in my HTML?
        >
        > <script>
        > function displayEditor()
        > {
        > //The Editor config
        > var myConfig = {
        > height: '300px',
        > width: '475px',
        > dompath: true,
        > focusAtStart: true,
        > handleSubmit: true,
        > animate: true
        > };
        >
        > //Now let's load the Editor
        > var myEditor = new YAHOO.widget.Editor('message', myConfig);
        > myEditor._defaultToolbar.titlebar = 'News Editor';
        > myEditor.render();
        > }
        >
        > YAHOO.util.Event.onDOMReady(displayEditor);
        > })();
        >
        > Instead of including that script in an external file, as I'd prefer
        > and as works with Firefox?
        >
        > <script type="application/x-javascript" language="JavaScript"
        > src="/scripts/forms/newsForm.js"></script>
        >
        > I prefer to have all of my scripts load from external files and use
        > onDOMReady type events to be kicked off, as opposed to being included
        > inline in my HTML. Is there something I'm missing to make my code
        > work in IE from an externally loaded file?
        >
        > Thanks,
        > Rob
        >

        The following worked in Firefox 2.0.0.20 and IE6:

        <html>
        <head>
        <title>Rich Text Editor</title>

        <!-- Combo-handled YUI CSS files: -->
        <link rel="stylesheet" type="text/css"
        href="http://yui.yahooapis.com/combo?2.6.0/build/assets/skins/sam/skin.css">
        <!-- Combo-handled YUI JS files: -->
        <script type="text/javascript"
        src="http://yui.yahooapis.com/combo?2.6.0/build/yahoo-dom-event/yahoo-dom-event.js&2.6.0/build/container/container_core-min.js&2.6.0/build/menu/menu-min.js&2.6.0/build/element/element-beta-min.js&2.6.0/build/button/button-min.js&2.6.0/build/editor/editor-min.js"></script>

        <script type="text/javascript" src="newsForm.js"></script>

        </head>

        <body class="yui-skin-sam">

        <div id="message"></div>

        </body>

        Here is the newsForm.js file:

        function displayEditor() {
        //The Editor config
        var myConfig = {
        height: '300px',
        width: '475px',
        dompath: true,
        focusAtStart: true,
        handleSubmit: true,
        animate: true
        };

        //Now let's load the Editor
        var myEditor = new YAHOO.widget.Editor('message', myConfig);
        myEditor._defaultToolbar.titlebar = 'News Editor';
        myEditor.render();
        }

        YAHOO.util.Event.onDOMReady(displayEditor);
      • cjavajim
        ... href= http://yui.yahooapis.com/combo?2.6.0/build/assets/skins/sam/skin.css ...
        Message 3 of 5 , Jan 1, 2009
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, "cjavajim" <cjavajim@...> wrote:
          >
          > --- In ydn-javascript@yahoogroups.com, "Rob Booth" <rob.o.booth@>
          > wrote:
          > >
          > > Why is it that I can only get the Rich Text Editor to load in IE when
          > > I place this script block in my HTML?
          > >
          > > <script>
          > > function displayEditor()
          > > {
          > > //The Editor config
          > > var myConfig = {
          > > height: '300px',
          > > width: '475px',
          > > dompath: true,
          > > focusAtStart: true,
          > > handleSubmit: true,
          > > animate: true
          > > };
          > >
          > > //Now let's load the Editor
          > > var myEditor = new YAHOO.widget.Editor('message', myConfig);
          > > myEditor._defaultToolbar.titlebar = 'News Editor';
          > > myEditor.render();
          > > }
          > >
          > > YAHOO.util.Event.onDOMReady(displayEditor);
          > > })();
          > >
          > > Instead of including that script in an external file, as I'd prefer
          > > and as works with Firefox?
          > >
          > > <script type="application/x-javascript" language="JavaScript"
          > > src="/scripts/forms/newsForm.js"></script>
          > >
          > > I prefer to have all of my scripts load from external files and use
          > > onDOMReady type events to be kicked off, as opposed to being included
          > > inline in my HTML. Is there something I'm missing to make my code
          > > work in IE from an externally loaded file?
          > >
          > > Thanks,
          > > Rob
          > >
          >
          > The following worked in Firefox 2.0.0.20 and IE6:
          >
          > <html>
          > <head>
          > <title>Rich Text Editor</title>
          >
          > <!-- Combo-handled YUI CSS files: -->
          > <link rel="stylesheet" type="text/css"
          >
          href="http://yui.yahooapis.com/combo?2.6.0/build/assets/skins/sam/skin.css">
          > <!-- Combo-handled YUI JS files: -->
          > <script type="text/javascript"
          >
          src="http://yui.yahooapis.com/combo?2.6.0/build/yahoo-dom-event/yahoo-dom-event.js&2.6.0/build/container/container_core-min.js&2.6.0/build/menu/menu-min.js&2.6.0/build/element/element-beta-min.js&2.6.0/build/button/button-min.js&2.6.0/build/editor/editor-min.js"></script>
          >
          > <script type="text/javascript" src="newsForm.js"></script>
          >
          > </head>
          >
          > <body class="yui-skin-sam">
          >
          > <div id="message"></div>
          >
          > </body>
          >
          > Here is the newsForm.js file:
          >
          > function displayEditor() {
          > //The Editor config
          > var myConfig = {
          > height: '300px',
          > width: '475px',
          > dompath: true,
          > focusAtStart: true,
          > handleSubmit: true,
          > animate: true
          > };
          >
          > //Now let's load the Editor
          > var myEditor = new YAHOO.widget.Editor('message', myConfig);
          > myEditor._defaultToolbar.titlebar = 'News Editor';
          > myEditor.render();
          > }
          >
          > YAHOO.util.Event.onDOMReady(displayEditor);
          >

          E.T.A. To answer your original question--IE6 (at least; I don't know
          about any other version[s] of IE) didn't like the
          "application/x-javascript" -- even though it is the W3C recommendation
          http://www.w3schools.com/media/media_mimeref.asp

          Changing "application/x-javascript" to "text/javascript" should make
          it work in IE (at least it does in IE6).
        • Rob Booth
          Thanks, changing to text/javascript did the trick. Now if I can just make the editor look nice in IE like it does in FF I d be happy. Rob
          Message 4 of 5 , Jan 4, 2009
          • 0 Attachment
            Thanks, changing to text/javascript did the trick. Now if I can just
            make the editor look nice in IE like it does in FF I'd be happy.

            Rob

            On Thu, Jan 1, 2009 at 9:57 PM, cjavajim <cjavajim@...> wrote:
            > --- In ydn-javascript@yahoogroups.com, "cjavajim" <cjavajim@...> wrote:
            >>
            >> --- In ydn-javascript@yahoogroups.com, "Rob Booth" <rob.o.booth@>
            >> wrote:
            >> >
            >> > Why is it that I can only get the Rich Text Editor to load in IE when
            >> > I place this script block in my HTML?
            >> >
            >> > <script>
            >> > function displayEditor()
            >> > {
            >> > //The Editor config
            >> > var myConfig = {
            >> > height: '300px',
            >> > width: '475px',
            >> > dompath: true,
            >> > focusAtStart: true,
            >> > handleSubmit: true,
            >> > animate: true
            >> > };
            >> >
            >> > //Now let's load the Editor
            >> > var myEditor = new YAHOO.widget.Editor('message', myConfig);
            >> > myEditor._defaultToolbar.titlebar = 'News Editor';
            >> > myEditor.render();
            >> > }
            >> >
            >> > YAHOO.util.Event.onDOMReady(displayEditor);
            >> > })();
            >> >
            >> > Instead of including that script in an external file, as I'd prefer
            >> > and as works with Firefox?
            >> >
            >> > <script type="application/x-javascript" language="JavaScript"
            >> > src="/scripts/forms/newsForm.js"></script>
            >> >
            >> > I prefer to have all of my scripts load from external files and use
            >> > onDOMReady type events to be kicked off, as opposed to being included
            >> > inline in my HTML. Is there something I'm missing to make my code
            >> > work in IE from an externally loaded file?
            >> >
            >> > Thanks,
            >> > Rob
            >> >
            >>
            >> The following worked in Firefox 2.0.0.20 and IE6:
            >>
            >> <html>
            >> <head>
            >> <title>Rich Text Editor</title>
            >>
            >> <!-- Combo-handled YUI CSS files: -->
            >> <link rel="stylesheet" type="text/css"
            >>
            > href="http://yui.yahooapis.com/combo?2.6.0/build/assets/skins/sam/skin.css">
            >> <!-- Combo-handled YUI JS files: -->
            >> <script type="text/javascript"
            >>
            > src="http://yui.yahooapis.com/combo?2.6.0/build/yahoo-dom-event/yahoo-dom-event.js&2.6.0/build/container/container_core-min.js&2.6.0/build/menu/menu-min.js&2.6.0/build/element/element-beta-min.js&2.6.0/build/button/button-min.js&2.6.0/build/editor/editor-min.js"></script>
            >>
            >> <script type="text/javascript" src="newsForm.js"></script>
            >>
            >> </head>
            >>
            >> <body class="yui-skin-sam">
            >>
            >> <div id="message"></div>
            >>
            >> </body>
            >>
            >> Here is the newsForm.js file:
            >>
            >> function displayEditor() {
            >> //The Editor config
            >> var myConfig = {
            >> height: '300px',
            >> width: '475px',
            >> dompath: true,
            >> focusAtStart: true,
            >> handleSubmit: true,
            >> animate: true
            >> };
            >>
            >> //Now let's load the Editor
            >> var myEditor = new YAHOO.widget.Editor('message', myConfig);
            >> myEditor._defaultToolbar.titlebar = 'News Editor';
            >> myEditor.render();
            >> }
            >>
            >> YAHOO.util.Event.onDOMReady(displayEditor);
            >>
            >
            > E.T.A. To answer your original question--IE6 (at least; I don't know
            > about any other version[s] of IE) didn't like the
            > "application/x-javascript" -- even though it is the W3C recommendation
            > http://www.w3schools.com/media/media_mimeref.asp
            >
            > Changing "application/x-javascript" to "text/javascript" should make
            > it work in IE (at least it does in IE6).
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.