Yes it does indeed. Sorry, I was getting confused by the fact that Firefox still doesn't like the fragment but it happens both when using a view and when using a template + snippet. The DOCTYPE is indeed missing in both cases when "S.skipDocType" is on, I guess what's still causing trouble is the fact that the XML declaration is still there.
I think I can remember seeing somewhere (group? blogs?) another flag that, when turned on, would skip the XML declaration but I can't find it right now. Is there really such a thing or did I only dream about it? Thanks. On 3 Giu, 17:57, David Pollak <[email protected]> wrote: > On Wed, Jun 3, 2009 at 7:40 AM, fatu <[email protected]> wrote: > > > ...Another question for now :-) > > > Does it work for views as well? > > It should. Views are treated just like static XHTML files... a source of > NodeSeq > > > > > > > Many thanks. > > > Fabio > > > On 21 Mag, 15:38, David Pollak <[email protected]> wrote: > > > On Thu, May 21, 2009 at 12:27 AM, fatu <[email protected]> wrote: > > > > > Right, didn't think about that alternative. > > > > > Thanks and best compliments to you and all the active Lift community > > > > for this superb Scala framework! I really think (and hope) it's going > > > > to have a big impact and a tremendous popularity rise in the next > > > > months, especially with more forthcoming books and articles spreading > > > > the word. > > > > We ask two things: build cool apps in Lift and be part of this community, > > > asking and answering questions. > > > > Thanks! > > > > > On 21 Mag, 06:42, David Pollak <[email protected]> wrote: > > > > > On Wed, May 20, 2009 at 8:38 PM, fatu <[email protected]> wrote: > > > > > > > Hi David, > > > > > > > yes it will do, thank you so much for such a lightning-fast > > > > > > development in reply! > > > > > > > I'm only thinking about a case that is probably much more of an > > > > > > exception than a rule, i.e. when the snippet dynamically decides if > > it > > > > > > needs to generate a full page or a fragment (which is not a very > > good > > > > > > design anyway IMHO), for example based on some info passed. But > > even > > > > > > in that case the snippet will know that and will be able to set > > > > > > S.skipDocType = true accordingly, so it should be perfectly fine. > > Plus > > > > > > it won't be difficult at all to make the processing diverge in the > > 2 > > > > > > cases by using URL rewrites, redirecting it to a different template > > / > > > > > > snippet depending on parameters or URL structure, which is probably > > a > > > > > > better design too. > > > > > > You could also pass a header flag from your AJAX call. If the > > header's > > > > set, > > > > > you don't do the boilerplate surround that'll include all the <html>, > > > > <head> > > > > > and <body> tags. > > > > > > Anyway, enjoy and thanks for the use case. > > > > > > Party on. > > > > > > > Again many thanks everyone and David especially! > > > > > > > On May 20, 4:05 pm, David Pollak <[email protected]> > > > > > > wrote: > > > > > > > I'm about to commit S.skipDocType = true | false. If you set it > > to > > > > true, > > > > > > > the <!DOCTYPE .../> will be omitted from the response page. This > > > > will > > > > > > allow > > > > > > > your AJAX fragements to pull parts of pages from the server. > > Note > > > > that > > > > > > > someplace in your snippets, you'll have to set S.skipDocType = > > true. > > > > > > > > Does this address your issue? > > > > > > > > On Wed, May 20, 2009 at 5:13 AM, fatu <[email protected]> wrote: > > > > > > > > > Hi Marius, > > > > > > > > > as I understand them, Jx classes help in generating JS that can > > > > itself > > > > > > > > generate DOM at the client. Am I wrong? I'd really like to > > serve > > > > back > > > > > > > > an HTML fragment built by using the normal Lift template > > pipeline > > > > (so > > > > > > > > including surround & bind). Is that possible? > > > > > > > > > Thanks > > > > > > > > > On 20 Mag, 13:16, "marius d." <[email protected]> wrote: > > > > > > > > > As I understood you want to make an Ajax request and serve > > back a > > > > > > > > > Document Fragment. If so please also take a look at Jx stuff. > > We > > > > > > > > > discuss Jx classes in a fairly amount of details in the lift > > > > book. > > > > > > > > > > Br's, > > > > > > > > > Marius > > > > > > > > > > On May 20, 9:32 am, fatu <[email protected]> wrote: > > > > > > > > > > > Timothy, > > > > > > > > > > > thanks for the links, I found them useful and I find your > > blog > > > > in > > > > > > > > > > general very interesting. Came across scala-blogs.org and > > it > > > > looks > > > > > > > > > > quite promising as well. > > > > > > > > > > > I knew "bind" already from the "Exploring Lift" book which > > I > > > > pull > > > > > > from > > > > > > > > > > git, build with Lyx and keep at hand regularly. In the > > doctype > > > > > > post, > > > > > > > > > > though, I couldn't find a way to specify "no doctype" > > which I > > > > > > think > > > > > > > > > > is necessary to serve a fragment; plus I couldn't find any > > > > other > > > > > > easy > > > > > > > > > > "out-of-the-box" way to do it. Shouldn't this use case > > (serving > > > > > > > > > > fragments), which I think is quite common, be better / more > > > > easily > > > > > > > > > > supported by the framework? Can someone post an example of > > how > > > > to > > > > > > do > > > > > > > > > > it with raw response handling in the meanwhile? > > > > > > > > > > > Thanks anybody. > > > > > > > > > > > Fabio > > > > > > > > > > > On 26 Apr, 21:49, Timothy Perrett <[email protected] > > > > > wrote: > > > > > > > > > > > > George, > > > > > > > > > > > > To tell lift what doctype you want to use see my blog > > post > > > > here: > > > > > > > >http://is.gd/uJ4L > > > > > > > > > > > > Also, you'll want to read another one of my posts in > > which I > > > > > > discuss > > > > > > > > > > > the bind(...) method and how you can stop putting markup > > into > > > > > > your > > > > > > > > > > > snippets:http://is.gd/sfyT > > > > > > > > > > > > Cheers, Tim > > > > > > > > > > > > On Apr 26, 1:02 pm, george <[email protected]> > > wrote: > > > > > > > > > > > > > hello all, > > > > > > > > > > > > > hopefully someone can help me out here. > > > > > > > > > > > > > i am trying to port some simple ajax stuff over to lift > > > > from a > > > > > > > > rails > > > > > > > > > > > > app. basically it just loads anhtmlfragmentand puts it > > into > > > > the > > > > > > dom > > > > > > > > > > > > using prototype. > > > > > > > > > > > > > i have set up a template which contains thefragmentat > > > > src/main/ > > > > > > > > > > > > webapp/fragment.html > > > > > > > > > > > > > <ul><li>item</li></ul> > > > > > > > > > > > > > then i made the page available using the SiteMap and > > all > > > > seems > > > > > > > > good, > > > > > > > > > > > > but here comes the problem > > > > > > > > > > > > > the lift response adds the xml declaration and doctype, > > one > > > > of > > > > > > > > which > > > > > > > > > > > > seems to cause prototype some problems > > > > > > > > > > > > > <?xml version="1.0" encoding="UTF-8"?> > > > > > > > > > > > > <!DOCTYPEhtmlPUBLIC "-//W3C//DTD XHTML 1.0 > > > > Transitional//EN" " > > > > > > > >http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > > > > > > > > > > > <ul><li>item</li></ul> > > > > > > > > > > > > > so the question is, how can i make lift send back the > > > > > > > > rawhtmlwithout > > > > > > > > > > > > meddling with it? > > > > > > > > > > > > > i have tried out using ResourceServer to serve it > > > > statically > > > > > > which > > > > > > > > > > > > works, but this wouldn't allow me to generate > > thefragment > > > > > > > > > > > > dynamically. > > > > > > > > > > > > > i would also prefer to have a separatehtmltemplate file > > > > rather > > > > > > than > > > > > > > > > > > > embedding the markup code in a snippet. > > > > > > > > > > > > > any thoughts gratefully received.. > > > > > > > > > > > > > george > > > > > > > > -- > > > > > > > Lift, the simply functional web frameworkhttp://liftweb.net > > > > > > > Beginning Scalahttp://www.apress.com/book/view/1430219890 > > > > > > > Follow me:http://twitter.com/dpp > > > > > > > Git some:http://github.com/dpp > > > > > > -- > > > > > Lift, the simply functional web frameworkhttp://liftweb.net > > > > > Beginning Scalahttp://www.apress.com/book/view/1430219890 > > > > > Follow me:http://twitter.com/dpp > > > > > Git some:http://github.com/dpp > > > > -- > > > Lift, the simply functional web frameworkhttp://liftweb.net > > > Beginning Scalahttp://www.apress.com/book/view/1430219890 > > > Follow me:http://twitter.com/dpp > > > Git some:http://github.com/dpp > > -- > Lift, the simply functional web frameworkhttp://liftweb.net > Beginning Scalahttp://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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
