[Lift] Re: Exception thrown in Firefox but not in IE. What Gives????

2009-04-11 Thread David Pollak
On Fri, Apr 10, 2009 at 9:49 PM, glenn gl...@exmbly.com wrote:


 I'm getting concerned about the viability of a Lift/JQuery web
 solution. I am trying to implement a widget around the
 jquery.mbContainerPlus.1.7.6 plugin. I can get it to work in  IE 7,
 but not in Firefox 3.08, where I get the following firebug error:

 [Exception... Component returned failure code: 0x80004003
 (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]  nsresult:
 0x80004003 (NS_ERROR_INVALID_POINTER)  location: JS frame ::
 http://localhost:8080/classpath/jquery-1.3.2.js :: anonymous :: line
 251  data: no]
 http://localhost:8080/classpath/jquery-1.3.2.js
 Line 251

 This has to do with an innerHtml line that shows up in jquery.js,
 although line 251 in that file is actually blank, so I don't know
 where it comes from.

 Creating the widget was simple. I just created a class to spit out the
 relevant NodeSeqs:

 class Container {
  def renderHead(xhtml: NodeSeq): NodeSeq = {

head
  link rel=stylesheet type=text/css href={/ +
 LiftRules.resourceServerPath +/mbContainer.css} title=style
 media=screen/
  script type=text/javascript src={/ +
 LiftRules.resourceServerPath + /mbContainer.js}/script
  script type=text/javascript src={/ +
 LiftRules.resourceServerPath + /ui.core.min.js}/script
  script type=text/javascript src={/ +
 LiftRules.resourceServerPath + /ui.draggable.min.js}/script
  script type=text/javascript src={/ +
 LiftRules.resourceServerPath + /ui.resizable.min.js}/script
  script type=text/javascript src={/ +
 LiftRules.resourceServerPath + /jquery.metadata.js}/
 script


This should be escaped in a ![CDATA[ block:



  script type=text/javascript{
Unparsed(
  $(function(){
$(.containerPlus).buildContainers({
containment:document,
elementsPath:elements/
});
});
)
   }
  /script
/head

  }


Why is this Unparsed?  Why not just use XML?



  def renderContainer(xhtml: NodeSeq): NodeSeq = {
  Unparsed(
  div class=containerPlus resizable {buttons:'m,c',
 skin:'white'}
div class=no
div class=ne
div class=nmain content/div
/div
div class=o
div class=e
div class=c
div class=contentThis is
 the main content/div
/div
/div
/div
div
div class=so
   div class=se
  div class=s/div
   /div
 /div
/div
/div
 /div
  )
  }

 If I have to jump through hoops to get it to work in Firefox, what
 good is Lift? Or, am I just missing something obvious? If anyone has
 had similar problems and has a workaround, please help.


The only problem I've ever had with Firefox is a bug related to attributes
with namespaces.

Please note that Lift serves XHTML and Firefox is very strict about
validating XHTML.  Unless you are serving your static page with a mime type
of application/xhtml+xml, you will not trigger Firefox's heightened
validation.




 By the way, if I just create an html file with the containerPlus node
 as above and display it in Firefox without using Lift, I don't get the
 error. Everything works great.

 Glenn Silverman

 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Exception thrown in Firefox but not in IE. What Gives????

2009-04-11 Thread glenn

Dave,

I appreciate your input. I've tried many permutations of code to try
to get this to work. The ![CDATA[ block didn;t work. I even just put
all the code into default.html as-is - no widget at all, no special
parsing involved, and still no luck.

I did get rid of the Firefox error by removing the unparsed stuff.
However, the code still doesn't work because I think it can't find the
elementsPath
 elements/. In fact, now it doesn't even work in IE.

This path contains all the images used by the container. I've placed
them in src\main\webapp\elements. Do
I also need to manage this somehow in Boot with ResourceServer.allow
and/or put the images someplace else?

The strange thing is that when I was getting the Firefox error, the
container images worked fine in IE. So it seemed the elementsPath was
OK.
This leads me to believe there is some parsing going on in Lift that I
just don't grasp. But, then again, it's probably something simple.

Glenn Silverman


On Apr 11, 6:53 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Fri, Apr 10, 2009 at 9:49 PM, glenn gl...@exmbly.com wrote:

  I'm getting concerned about the viability of a Lift/JQuery web
  solution. I am trying to implement a widget around the
  jquery.mbContainerPlus.1.7.6 plugin. I can get it to work in  IE 7,
  but not in Firefox 3.08, where I get the following firebug error:

  [Exception... Component returned failure code: 0x80004003
  (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]  nsresult:
  0x80004003 (NS_ERROR_INVALID_POINTER)  location: JS frame ::
 http://localhost:8080/classpath/jquery-1.3.2.js:: anonymous :: line
  251  data: no]
 http://localhost:8080/classpath/jquery-1.3.2.js
  Line 251

  This has to do with an innerHtml line that shows up in jquery.js,
  although line 251 in that file is actually blank, so I don't know
  where it comes from.

  Creating the widget was simple. I just created a class to spit out the
  relevant NodeSeqs:

  class Container {
   def renderHead(xhtml: NodeSeq): NodeSeq = {

     head
       link rel=stylesheet type=text/css href={/ +
  LiftRules.resourceServerPath +/mbContainer.css} title=style
  media=screen/
       script type=text/javascript src={/ +
  LiftRules.resourceServerPath + /mbContainer.js}/script
       script type=text/javascript src={/ +
  LiftRules.resourceServerPath + /ui.core.min.js}/script
       script type=text/javascript src={/ +
  LiftRules.resourceServerPath + /ui.draggable.min.js}/script
       script type=text/javascript src={/ +
  LiftRules.resourceServerPath + /ui.resizable.min.js}/script
       script type=text/javascript src={/ +
  LiftRules.resourceServerPath + /jquery.metadata.js}/
  script

 This should be escaped in a ![CDATA[ block:





       script type=text/javascript{
         Unparsed(
           $(function(){
                         $(.containerPlus).buildContainers({
                                 containment:document,
                                 elementsPath:elements/
                         });
                 });
         )
        }
       /script
     /head

   }

 Why is this Unparsed?  Why not just use XML?





   def renderContainer(xhtml: NodeSeq): NodeSeq = {
       Unparsed(
       div class=containerPlus resizable {buttons:'m,c',
  skin:'white'}
                 div class=no
                         div class=ne
                                 div class=nmain content/div
                         /div
                         div class=o
                                 div class=e
                                         div class=c
                                                 div class=contentThis is
  the main content/div
                                         /div
                                 /div
                         /div
                         div
                         div class=so
                                div class=se
                                       div class=s/div
                                    /div
                                  /div
                     /div
                 /div
      /div
       )
   }

  If I have to jump through hoops to get it to work in Firefox, what
  good is Lift? Or, am I just missing something obvious? If anyone has
  had similar problems and has a workaround, please help.

 The only problem I've ever had with Firefox is a bug related to attributes
 with namespaces.

 Please note that Lift serves XHTML and Firefox is very strict about
 validating XHTML.  Unless you are serving your static page with a mime type
 of application/xhtml+xml, you will not trigger Firefox's heightened
 validation.



  By the way, if I just create an html file with the containerPlus node
  as above and display it in Firefox without using Lift, I don't get the
  error. Everything works great.

  Glenn Silverman

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp

[Lift] Re: Exception thrown in Firefox but not in IE. What Gives????

2009-04-11 Thread David Pollak
Please post a simple example that fails on Firefox.  I'll clean it up for
you.

On Sat, Apr 11, 2009 at 11:42 AM, glenn gl...@exmbly.com wrote:


 Dave,

 I appreciate your input. I've tried many permutations of code to try
 to get this to work. The ![CDATA[ block didn;t work. I even just put
 all the code into default.html as-is - no widget at all, no special
 parsing involved, and still no luck.

 I did get rid of the Firefox error by removing the unparsed stuff.
 However, the code still doesn't work because I think it can't find the
 elementsPath
  elements/. In fact, now it doesn't even work in IE.

 This path contains all the images used by the container. I've placed
 them in src\main\webapp\elements. Do
 I also need to manage this somehow in Boot with ResourceServer.allow
 and/or put the images someplace else?

 The strange thing is that when I was getting the Firefox error, the
 container images worked fine in IE. So it seemed the elementsPath was
 OK.
 This leads me to believe there is some parsing going on in Lift that I
 just don't grasp. But, then again, it's probably something simple.

 Glenn Silverman


 On Apr 11, 6:53 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Fri, Apr 10, 2009 at 9:49 PM, glenn gl...@exmbly.com wrote:
 
   I'm getting concerned about the viability of a Lift/JQuery web
   solution. I am trying to implement a widget around the
   jquery.mbContainerPlus.1.7.6 plugin. I can get it to work in  IE 7,
   but not in Firefox 3.08, where I get the following firebug error:
 
   [Exception... Component returned failure code: 0x80004003
   (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]  nsresult:
   0x80004003 (NS_ERROR_INVALID_POINTER)  location: JS frame ::
  http://localhost:8080/classpath/jquery-1.3.2.js:: anonymous :: line
   251  data: no]
  http://localhost:8080/classpath/jquery-1.3.2.js
   Line 251
 
   This has to do with an innerHtml line that shows up in jquery.js,
   although line 251 in that file is actually blank, so I don't know
   where it comes from.
 
   Creating the widget was simple. I just created a class to spit out the
   relevant NodeSeqs:
 
   class Container {
def renderHead(xhtml: NodeSeq): NodeSeq = {
 
  head
link rel=stylesheet type=text/css href={/ +
   LiftRules.resourceServerPath +/mbContainer.css} title=style
   media=screen/
script type=text/javascript src={/ +
   LiftRules.resourceServerPath + /mbContainer.js}/script
script type=text/javascript src={/ +
   LiftRules.resourceServerPath + /ui.core.min.js}/script
script type=text/javascript src={/ +
   LiftRules.resourceServerPath + /ui.draggable.min.js}/script
script type=text/javascript src={/ +
   LiftRules.resourceServerPath + /ui.resizable.min.js}/script
script type=text/javascript src={/ +
   LiftRules.resourceServerPath + /jquery.metadata.js}/
   script
 
  This should be escaped in a ![CDATA[ block:
 
 
 
 
 
script type=text/javascript{
  Unparsed(
$(function(){
  $(.containerPlus).buildContainers({
  containment:document,
  elementsPath:elements/
  });
  });
  )
 }
/script
  /head
 
}
 
  Why is this Unparsed?  Why not just use XML?
 
 
 
 
 
def renderContainer(xhtml: NodeSeq): NodeSeq = {
Unparsed(
div class=containerPlus resizable {buttons:'m,c',
   skin:'white'}
  div class=no
  div class=ne
  div class=nmain content/div
  /div
  div class=o
  div class=e
  div class=c
  div
 class=contentThis is
   the main content/div
  /div
  /div
  /div
  div
  div class=so
 div class=se
div class=s/div
 /div
   /div
  /div
  /div
   /div
)
}
 
   If I have to jump through hoops to get it to work in Firefox, what
   good is Lift? Or, am I just missing something obvious? If anyone has
   had similar problems and has a workaround, please help.
 
  The only problem I've ever had with Firefox is a bug related to
 attributes
  with namespaces.
 
  Please note that Lift serves XHTML and Firefox is very strict about
  validating XHTML.  Unless you are serving your static page with a mime
 type
  of application/xhtml+xml, you will not trigger Firefox's heightened
  validation.
 
 
 
   By the way, if I just create an html file with the containerPlus node