problems adding uservoice javascript (follow-up)

7 views
Skip to first unread message

zziemke

unread,
Jul 24, 2010, 6:57:59 AM7/24/10
to Lift
Hi guys,
this is a continuation of
http://scala-programming-language.1934581.n4.nabble.com/Has-anyone-gotten-the-uservoice-javascript-to-work-td1981665.html

The suggested LiftRules.useXhtmlMimeType = false; didn't work for me,
so I created a demo project:

http://github.com/zziemke/uservoice-bug-demo

Would be very much appreciated if you guys look into this issue.
Thanks!

zziemke

unread,
Jul 25, 2010, 11:41:41 AM7/25/10
to Lift
nobody?

On Jul 24, 12:57 pm, zziemke <zzie...@googlemail.com> wrote:
> Hi guys,
> this is a continuation ofhttp://scala-programming-language.1934581.n4.nabble.com/Has-anyone-go...

Timothy Perrett

unread,
Jul 25, 2010, 12:14:58 PM7/25/10
to lif...@googlegroups.com
Its the weekend. Be patient, you will likely get a response in the week. Whilst we do our best to cover the list over the weekends, for things that are more involved such as this we dont always have time to take from our other life commitments.

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

Ziemke Zeno

unread,
Jul 25, 2010, 1:38:56 PM7/25/10
to lif...@googlegroups.com
you're right, i'm sorry

Ross Mellgren

unread,
Jul 25, 2010, 3:16:38 PM7/25/10
to lif...@googlegroups.com, lif...@googlegroups.com
I might be able to take a look at this for you later tonight, time permitting.

-Ross

David Pollak

unread,
Jul 25, 2010, 7:37:25 PM7/25/10
to lif...@googlegroups.com
On Sun, Jul 25, 2010 at 9:14 AM, Timothy Perrett <tim...@getintheloop.eu> wrote:
Its the weekend. Be patient, you will likely get a response in the week. Whilst we do our best to cover the list over the weekends, for things that are more involved such as this we dont always have time to take from our other life commitments.

Just to reinforce what Tim said, the folks on this list do not owe anyone an answer, nor do we answer questions in a specific time period.

Yes, we care a lot about answering folks questions and helping them be successful with Lift and build really cool things.  On the other hand, we're not getting paid for this work, so you will have to wait for answers.

In terms of my own personal rules (this does not apply to any other folks who commonly answer questions) are:
  • If you have helped other people on the list, I'm far more likely to help you
  • If you're asking a non-trivial question, I look for some research into the issue and sample code
  • If you're asking a trivial question, I'll answer it quickly, but look for you to help out in the future
  • If you bump a question, I'll most likely actively ignore it (I've got 5 year olds and have found that rewarding behavior with attention causes that behavior to happen more frequently and I don't want everybody bumping their questions... it just adds to noise.)
  • If you contact me privately (unless we've got a pre-existing relationship or both have a strong relationship with a common person [e.g., I'm a friend of Jorge Ortiz and I need some private help with XXX, do you have time?]) I will most likely never give you support again
There are plenty of people on this list who are consultants.  If you need quick turn-around to your answers, offer a bounty or enter into a contract with one of the consultants to answer your questions.

With that being said, the OP should re-read the link he posted.  The answer to the problem is in the original answer he linked to (hint: XML is not HTML and Lift does everything in XML, even if the mime type is HTML).
 



On 25 Jul 2010, at 16:41, zziemke wrote:

> nobody?
>
> On Jul 24, 12:57 pm, zziemke <zzie...@googlemail.com> wrote:
>> Hi guys,
>> this is a continuation ofhttp://scala-programming-language.1934581.n4.nabble.com/Has-anyone-go...
>>
>> The suggested LiftRules.useXhtmlMimeType = false;  didn't work for me,
>> so I created a demo project:
>>
>> http://github.com/zziemke/uservoice-bug-demo
>>
>> Would be very much appreciated if you guys look into this issue.
>> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups "Lift" group.
> To post to this group, send email to lif...@googlegroups.com.
> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
>
>

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




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Ross Mellgren

unread,
Jul 26, 2010, 12:39:25 AM7/26/10
to lif...@googlegroups.com
Sorry, it doesn't compile:

rmm@Hugo:~/uservoice-bug-demo$ sbt compile
[info] Building project bug_report 1.0 against Scala 2.7.7
[info] using Project with sbt 0.7.4 and Scala 2.7.7
[info]
[info] == compile ==
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling main sources...
[error] /Users/rmm/uservoice-bug-demo/src/main/scala/bootstrap/liftweb/Boot.scala:8: value watchedit is not a member of package com
[error] import com.watchedit.classes._
[error] ^
[error] one error found
[info] == compile ==
[error] Error running compile: Compilation failed
[info]
[info] Total time: 3 s, completed Jul 26, 2010 12:31:04 AM
[info]
[info] Total session time: 3 s, completed Jul 26, 2010 12:31:04 AM
[error] Error during build.


-Ross

On Jul 25, 2010, at 4:08 PM, Ziemke Zeno wrote:

> would be great :D
> thanks >:)

Ziemke Zeno

unread,
Jul 25, 2010, 4:08:55 PM7/25/10
to lif...@googlegroups.com
would be great :D
thanks >:)
On 25.07.2010, at 21:16, Ross Mellgren wrote:

zziemke

unread,
Jul 29, 2010, 12:21:47 PM7/29/10
to Lift
Sorry for the delay, my computer was broken
I fixed the bug

On 25 Jul., 22:08, Ziemke Zeno <zzie...@googlemail.com> wrote:
> would be great :D
> thanks >:)
> On 25.07.2010, at 21:16, Ross Mellgren wrote:
>
>
>
> > I might be able to take a look at this for you later tonight, time permitting.
>
> > -Ross
>
> > On Jul 25, 2010, at 1:38 PM, Ziemke Zeno <zzie...@googlemail.com> wrote:
>
> >> you're right, i'm sorry
> >> On 25.07.2010, at 18:14, Timothy Perrett wrote:
>
> >>> Its the weekend. Be patient, you will likely get a response in the week. Whilst we do our best to cover the list over the weekends, for things that are more involved such as this we dont always have time to take from our other life commitments.
>
> >>> On 25 Jul 2010, at 16:41, zziemke wrote:
>
> >>>> nobody?
>
> >>>> On Jul 24, 12:57 pm, zziemke <zzie...@googlemail.com> wrote:
> >>>>> Hi guys,
> >>>>> this is a continuation ofhttp://scala-programming-language.1934581.n4.nabble.com/Has-anyone-go...
>
> >>>>> The suggested LiftRules.useXhtmlMimeType = false;  didn't work for me,
> >>>>> so I created a demo project:
>
> >>>>>http://github.com/zziemke/uservoice-bug-demo
>
> >>>>> Would be very much appreciated if you guys look into this issue.
> >>>>> Thanks!
>
> >>>> --
> >>>> You received this message because you are subscribed to the Google Groups "Lift" group.
> >>>> To post to this group, send email to lif...@googlegroups.com.
> >>>> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> >>>> For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en.
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups "Lift" group.
> >>> To post to this group, send email to lif...@googlegroups.com.
> >>> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> >>> For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups "Lift" group.
> >> To post to this group, send email to lif...@googlegroups.com.
> >> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> >> For more options, visit this group athttp://groups.google.com/group/liftweb?hl=en.

Ross Mellgren

unread,
Jul 29, 2010, 4:34:47 PM7/29/10
to lif...@googlegroups.com
So there are two problems.

The first _is_ resolved by useXhtmlMimeType = false, if you checked firebug you'll notice that it changes to a parse error on this line (as viewed using Safari's developer tools):

s.setAttribute('src', (&quot;https:&quot; == document.location.protocol ? &quot;https://&q

This is the second problem. You'll notice all those &quot;s that shouldn't be there. This is because this (from uservoice.html) is incorrect XML:

<script type="text/javascript">
...
s.setAttribute('type', 'text/javascript');
s.setAttribute('src', ("https:" == document.location.protocol ? "https://" : "http://") + "cdn.uservoice.com/javascripts/widgets/tab.js");
document.getElementsByTagName('head')[0].appendChild(s);
...
</script>

In XML, double quotes are not legal except as part of attributes. To fix this you need to tell XML that the whole content of the <script> tag is raw text that should be passed, not XML. The way to do this is using <![CDATA[ ... ]]>, which you can see in use if you look at the source of your page from the browser, since Lift is inserting script tags using this:

<script type="text/javascript">
// <![CDATA[

var lift_page = "F754949135290TOX";
// ]]>
</script>

So, if you add

// <![CDATA[

just after <script> and

// ]]>

just before </script>, the problem should vanish.

Hope that explains,
-Ross

zziemke

unread,
Aug 3, 2010, 4:04:11 AM8/3/10
to Lift
Thank you very much!

Works like a charm :D

On 29 Jul., 22:34, Ross Mellgren <dri...@gmail.com> wrote:
> So there are two problems.
>
> The first _is_ resolved by useXhtmlMimeType = false, if you checked firebug you'll notice that it changes to a parse error on this line (as viewed using Safari's developer tools):
>
>   s.setAttribute('src', (&quot;https:&quot; == document.location.protocol ? &quot;https://&q
>
> This is the second problem. You'll notice all those &quot;s that shouldn't be there. This is because this (fromuservoice.html) is incorrect XML:
Reply all
Reply to author
Forward
0 new messages