[Proto-Scripty] Re: Weird Select list behavior in IE7
Hi all, I have solved my issue by by using: this.select.options[i] = new Option(opt.value, opt.key, null, false); rather than this.select.insert({'bottom': new Element('option', {'value':opt.key}).update(opt.value)}); Thanks to everyone who gave this some thought! (Sorry for the top post) -- Nich On Aug 17, 10:26 am, Nich wrote: > Hi all, > > I have a site that i need to make work in IE7 but i have run into a > very frustrating issue. > > I am using django to generate the form for a payment request. As a > part of this form the user can input one or more breakdowns for this > payment, Because I only want to write the form once I duplicate the > breakdown using element.clone() and then clean it up before creating a > new form. I have this all working quite nicely. The issue I'm having > is when I combine this behavior with some code I have to allow the > filtering of lists. > > The issue occurs in IE7 and IE8 when rendering as IE7. It does not > occur in any other browser I have tested. > > Here is an example: > > http://www.lccare.org.au/~nsteicke/selectissue/ > > To replicate, use IE7 or IE8 in IE7 compatibly mode, then click '+ Add > Breakdown' and then filter the new select list and try and expand the > list. > > Any assistance you can offer in solving this issue would be great. > > -- Nich -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: Should be simple - using up() with css class
up() looks for a matching ancester in the DOM, not a sibling (brother) that was before it in the DOM. I think this will work : $('part-47').up().down('tr.sd_type').id On 17 août, 22:47, Rhiq wrote: > I obviously don't get the way up() works. Using the generated HTML > below: > > > Type: Test Type > > Rename | > Add Part | > In Use (3) > > > > Part: dfgdfg (0) > > Rename | > Remove > > > > Part: sdfgs (0) > > Rename | > Remove > > > > Part: fdsgre (0) > > Rename | > Remove > > > > If I try the following: > alert($('part-47').up('tr.sd_type').id) I get an error saying that it > is undefined. > > Does it make sense to anyone what I am trying to do? Is there a way > for me to do what I would like? > > I am trying to make changes to the first with the class "sd_type" > above the current (in this case tr#part-47). > > Any help would be awesome. > Nathan -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Should be simple - using up() with css class
I obviously don't get the way up() works. Using the generated HTML below: Type: Test Type Rename | Add Part | In Use (3) Part: dfgdfg (0) Rename | Remove Part: sdfgs (0) Rename | Remove Part: fdsgre (0) Rename | Remove If I try the following: alert($('part-47').up('tr.sd_type').id) I get an error saying that it is undefined. Does it make sense to anyone what I am trying to do? Is there a way for me to do what I would like? I am trying to make changes to the first with the class "sd_type" above the current (in this case tr#part-47). Any help would be awesome. Nathan -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: prototype to populate select box via ajax
Here is a completed function that will populate a select box with data in an XML format (XML format below): // fill the dropdown list box // @ajax response (transport as returned above) // @id of the select field (defaults to elFieldName // @xml_data_node_name (our dataset uses 'state') function fillSelectList(transport, select_id, xml_data_node) { var states, state, selbox, options; // Get & validate response states = transport.responseXML.getElementsByTagName(xml_data_node); $(select_id).options.length = 1; for(var i = 0; i < states.length; i++) { var value = states[i].getAttribute('value'); var name= states[i].getAttribute('name'); // i+1 allows us to skip over the first item in the // pulldown which prompts the user to "Pick One" $(select_id).options[i+1] = new Option(name, value, null, false); } } XML Data John Doe j...@gmail.com Thanks to T.J. and Colin Mollenhour for their help on this! -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: prototype to populate select box via ajax
T.J. YOU are a gentleman AND a scholar! I looked everywhere for how to do this! Hopefully this post will move up in the search engines and others can find it! One other question on this... What if the XML response is: more and more California Arkansas How do I need to format this line? states = response.responseXML && response.responseXML.firstChild; (I think I need a good primer on how this is working... LOL) Thanks, Pete On Tue, Aug 17, 2010 at 2:32 AM, T.J. Crowder wrote: > Hi, > > The XML can be in whatever form you find useful to parse. Here's a > complete example that handles an XML response that looks like this: > > CaliforniaArkansas state> > > Code (also -- more readably -- here: http://pastie.org/1097106): > * * * * > > > > > Test Page > > body { >font-family: sans-serif; > } > #log p { >margin: 0; >padding:0; > } > > > > document.observe('dom:loaded', function() { >$('btnGo').observe('click', go); > >function go() { >new Ajax.Request("getlist.jsp", { >onSuccess: getlistSuccess, >onFailure: getlistFailure, >on0:getlistFailure >}); >} > >function getlistSuccess(response) { >var states, >state, >selbox, >options; > >// Validate response >states = response.responseXML && > response.responseXML.firstChild; >if (!states || >!states.tagName || >states.tagName != "states") { >getlistFailure(response); >return; >} > >// Get the select box and its options "array" (not really an > array) >selbox = $('selectbox'); >options = selbox.options; > >// Loop the states >for (state = states.firstChild; state; state = > state.nextSibling) { >options[selbox.options.length] = new Option( >state.firstChild.nodeValue, >state.getAttribute("code") >); >} >} > >function getlistFailure(response) { >log("getlist call failed"); >} > >var write = log; >function log(msg) { >$('log').appendChild(new Element('p').update(msg)); >} > }); > > > > > > > > > > * * * * > > HTH, > -- > T.J. Crowder > Independent Software Consultant > tj / crowder software / com > www.crowdersoftware.com > > On Aug 16, 10:00 pm, Phil Petree wrote: > > I've looked everywhere for a solution to this and hacked around with it > all > > day with no luck. > > > > How do we populate a select box using xml data obtained from an ajax > > request. > > > > If what I get back from the fillin example is this: > > > > Jack > > Flash > > jfl...@candlestick.com > > > > > > And I want to add a list of US states to a select box but obviously we > can't > > have > > > > AK > > AL > > > > So question 1 is: What's the correct format for the XML response? > > > > My 2nd question is how do I break out the seperate parts from the > transport > > response? > > > transport.responseXML.getElementsByTagName('$fieldname')[0].firstChild.node > Value; > > > > My 3rd question is, will the following code work for populating the > select > > box? > > opt.text = "Alaska"; > > opt.value = AK; > > $("DropDownStateList").options.add(opt);// Assign > > text and value to Option object > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > prototype-scriptacul...@googlegroups.com. > To unsubscribe from this group, send email to > prototype-scriptaculous+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Re: Appending a template evaluation to an HTML element.
On 17 August 2010 16:34, T.J. Crowder wrote: > Hi, > > The original code: > > $('vsNewUsers').update($('vsNewUsers').innerHTML + > tmpl_NewUser.evaluate({NewUserID : --i_NewUserID})); > > ...will require the browser to spin through the tree inside vsNewUsers > and create an equivalent HTML string to give you; then tear down that > tree, parse the HTML you give it back (including re-parsing the stuff > it just gave you), re-instantiate a lot of elements that look exactly > the same as the previous one (plus the new ones at the end), re- > calculate the layout of the previous elements (and then the additional > ones), etc. (Layout can be expensive with tables, too, so...) > > Seems like unnecessary work. :-) Granted the browser's going to do it > really fast, but still. Also, you'd lose any event handlers you'd > hooked up to the elements in there and any other data you may have > stored on them. If your user is using IE, any elements that > Prototype's already extended will have to be re-extended (which takes > non-trivial time on big tables). > > Fortunately, Element#insert[1] is for exactly this situation: > > $('vsNewUsers').insert({ > bottom: tmpl_NewUser.evaluate({NewUserID : --i_NewUserID}) > }); > > [1] http://api.prototypejs.org/dom/element/insert/ > > Vis-a-vis using `new Element` rather than HTML: Parsing HTML and > showing the result on the page is fundamentally what browsers do, and > they do it really, _really_ fast. When rendering HTML, they can work > directly with their internal structures. When you use the DOM API, you > lose that benefit and have to work through the browser's DOM API -> > internal structures mapping. And you're doing all of your work in an > interpreted (or at least compiled-on-the-fly) language. > > Net result? Markedly slower -- like an order of magnitude -- to go > through the DOM API vs. using HTML. This isn't a Prototype thing at > all, it's just the nature of browsers and what they're optimized for. > I actually did a test page (not much of one) a little over a year back > when answering a question for someone that showed this in action, and > through the wonder that is 'net search: > http://pastie.org/521342 > > HTH, > -- > T.J. Crowder > Independent Software Consultant > tj / crowder software / com > www.crowdersoftware.com > > On Aug 17, 2:09 pm, Phil Petree wrote: >> I would think that Creating elements is less limiting... but I have no idea >> what most developers do. >> >> On Tue, Aug 17, 2010 at 8:29 AM, Richard Quadling wrote: >> >> >> >> > On 17 August 2010 12:59, Phil Petree wrote: >> > > === >> > > HTML save as index.html: >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > Keyword >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > var nextkeyid = 2; >> > > function addkeyword() >> > > { >> > > var elTR = $('keytable').insertRow( -1 ); >> > > var elTitleTD = elTR.insertCell( -1 ); >> > > elTitleTD.appendChild( document.createTextNode( 'Keyword' ) ); >> > > var elInput = document.createElement( 'input' ); >> > > elInput.type = 'text'; >> > > elInput.name = 'keyword_'+nextkeyid; >> > > nextkeyid++; >> > > var elInputTD = elTR.insertCell( -1 ); >> > > elInputTD.appendChild( elInput ); >> > > } >> > > function dosubmit( ) { >> > > new Ajax.Updater( 'result', 'add.php', { method: 'post', parameters: >> > > $('myform').serialize() } ); >> > > } >> > > >> > > >> > > >> > > === >> > > Serverside PHP save as add.php: >> >> > > Post Result: >> > > >> > > === >> > > On Tue, Aug 17, 2010 at 7:30 AM, Richard Quadling >> > > wrote: >> >> > >> On 17 August 2010 12:01, Phil Petree wrote: >> > >> > That's in the expando example that comes with prototype.js 1.6x >> >> > >> > On Tue, Aug 17, 2010 at 6:35 AM, Richard Quadling < >> > rquadl...@gmail.com> >> > >> > wrote: >> >> > >> >> Hi. >> >> > >> >> I've implemented a simple "add new user" button to my "amend users" >> > >> >> page. The user list is only about 20 people, with >> > >> >> name/email/pin/contracts/delete options. >> >> > >> >> The button calls a template evaluation and that is within an update >> > ... >> >> > >> >> $('vsNewUsers').update($('vsNewUsers').innerHTML + >> > >> >> tmpl_NewUser.evaluate({NewUserID : --i_NewUserID})); >> >> > >> >> All working fine. >> >> > >> >> I like how it works, but I wonder how I can just append the result of >> > >> >> the evaluation. >> >> > >> >> How do I take a template and append the results to vsNewUsers. >> > >> >> vsNewUsers is a tbody element and the template is a element with >> > >> >> all the 's needed. >> >> > >> >> var tmpl_NewUser = new Template('> > >> >> name="User[#{NewUserID}][Username]" value="" maxlength="200" >> > size="50" >> > >> >> />> > >> >> value="" maxlength="200" size="50" />> > >> >> name="User[#{NewUserID}][PIN]" value=""
[Proto-Scripty] Re: Appending a template evaluation to an HTML element.
Hi, The original code: $('vsNewUsers').update($('vsNewUsers').innerHTML + tmpl_NewUser.evaluate({NewUserID : --i_NewUserID})); ...will require the browser to spin through the tree inside vsNewUsers and create an equivalent HTML string to give you; then tear down that tree, parse the HTML you give it back (including re-parsing the stuff it just gave you), re-instantiate a lot of elements that look exactly the same as the previous one (plus the new ones at the end), re- calculate the layout of the previous elements (and then the additional ones), etc. (Layout can be expensive with tables, too, so...) Seems like unnecessary work. :-) Granted the browser's going to do it really fast, but still. Also, you'd lose any event handlers you'd hooked up to the elements in there and any other data you may have stored on them. If your user is using IE, any elements that Prototype's already extended will have to be re-extended (which takes non-trivial time on big tables). Fortunately, Element#insert[1] is for exactly this situation: $('vsNewUsers').insert({ bottom: tmpl_NewUser.evaluate({NewUserID : --i_NewUserID}) }); [1] http://api.prototypejs.org/dom/element/insert/ Vis-a-vis using `new Element` rather than HTML: Parsing HTML and showing the result on the page is fundamentally what browsers do, and they do it really, _really_ fast. When rendering HTML, they can work directly with their internal structures. When you use the DOM API, you lose that benefit and have to work through the browser's DOM API -> internal structures mapping. And you're doing all of your work in an interpreted (or at least compiled-on-the-fly) language. Net result? Markedly slower -- like an order of magnitude -- to go through the DOM API vs. using HTML. This isn't a Prototype thing at all, it's just the nature of browsers and what they're optimized for. I actually did a test page (not much of one) a little over a year back when answering a question for someone that showed this in action, and through the wonder that is 'net search: http://pastie.org/521342 HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Aug 17, 2:09 pm, Phil Petree wrote: > I would think that Creating elements is less limiting... but I have no idea > what most developers do. > > On Tue, Aug 17, 2010 at 8:29 AM, Richard Quadling wrote: > > > > > On 17 August 2010 12:59, Phil Petree wrote: > > > === > > > HTML save as index.html: > > > > > > > > > > > > > > > > > > > > > > > > Keyword > > > > > > > > > > > > > > > > > > > > > > > > var nextkeyid = 2; > > > function addkeyword() > > > { > > > var elTR = $('keytable').insertRow( -1 ); > > > var elTitleTD = elTR.insertCell( -1 ); > > > elTitleTD.appendChild( document.createTextNode( 'Keyword' ) ); > > > var elInput = document.createElement( 'input' ); > > > elInput.type = 'text'; > > > elInput.name = 'keyword_'+nextkeyid; > > > nextkeyid++; > > > var elInputTD = elTR.insertCell( -1 ); > > > elInputTD.appendChild( elInput ); > > > } > > > function dosubmit( ) { > > > new Ajax.Updater( 'result', 'add.php', { method: 'post', parameters: > > > $('myform').serialize() } ); > > > } > > > > > > > > > > > > === > > > Serverside PHP save as add.php: > > > > Post Result: > > > > > > === > > > On Tue, Aug 17, 2010 at 7:30 AM, Richard Quadling > > > wrote: > > > >> On 17 August 2010 12:01, Phil Petree wrote: > > >> > That's in the expando example that comes with prototype.js 1.6x > > > >> > On Tue, Aug 17, 2010 at 6:35 AM, Richard Quadling < > > rquadl...@gmail.com> > > >> > wrote: > > > >> >> Hi. > > > >> >> I've implemented a simple "add new user" button to my "amend users" > > >> >> page. The user list is only about 20 people, with > > >> >> name/email/pin/contracts/delete options. > > > >> >> The button calls a template evaluation and that is within an update > > ... > > > >> >> $('vsNewUsers').update($('vsNewUsers').innerHTML + > > >> >> tmpl_NewUser.evaluate({NewUserID : --i_NewUserID})); > > > >> >> All working fine. > > > >> >> I like how it works, but I wonder how I can just append the result of > > >> >> the evaluation. > > > >> >> How do I take a template and append the results to vsNewUsers. > > >> >> vsNewUsers is a tbody element and the template is a element with > > >> >> all the 's needed. > > > >> >> var tmpl_NewUser = new Template(' > >> >> name="User[#{NewUserID}][Username]" value="" maxlength="200" > > size="50" > > >> >> /> > >> >> value="" maxlength="200" size="50" /> > >> >> name="User[#{NewUserID}][PIN]" value="" maxlength="4" > > >> >> /> > >> >> name="User[#{NewUserID}][AllContracts]" value="1" > > >> >> id="allContracts_#{NewUserID}" /> > >> >> name="User[#{NewUserID}][ContactIDs]" value="" maxlength="200" > > >> >> disabled="disabled"
Re: [Proto-Scripty] Re: 4 different browsers - 4 different responses
One thing to add here (in agreement with TJ) is that Prototype demands a valid page in order to work predictably. If a particular page or effect won't work correctly, the answer might be in the HTML or it might be in the JavaScript. And they're both valid points to discuss here, in my opinion, because they bear on getting the framework to, well, work. Walter On Aug 17, 2010, at 11:15 AM, T.J. Crowder wrote: I don't see how this went too far afield at all -- at least not nearly enough to bother to comment on it. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] scriptaculous causes body background to fail on safari and chrome
On 17 August 2010 16:29, Richard Quadling wrote: > On 17 August 2010 16:13, Guillaume Lepicard > wrote: >> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> >> http://www.w3.org/1999/xhtml";> >> >> BG fail >> >> body { >> background-color: #00; >> color:#ff; >> } >> >> >> >> >> >> Hello >> >> > > Oh strange. > > I've just loaded Safari V5.01 (7533.17.8) and got the same issue. > White hello in a black banner. White remainder of page. > > Right click and choose inspect, background is now all black as expected. > > Works fine in Chrome V6.0.472.36 beta, IE 8 and FireFox V3.6.8 > > > -- > Richard Quadling. > Just in case there was anything I missed, I pasted the code into w3c's validator. All OK. On the surface of it, it looks like a webkit bug. What version of Chrome are you using? -- Richard Quadling. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] scriptaculous causes body background to fail on safari and chrome
my chrome version is 5.0.375.126 i had the same issue with safari 4 On Tue, Aug 17, 2010 at 5:29 PM, Richard Quadling wrote: > On 17 August 2010 16:13, Guillaume Lepicard > wrote: > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > > http://www.w3.org/1999/xhtml";> > > > > BG fail > > > > body { > > background-color: #00; > > color:#ff; > > } > > > > > > > > > > > > Hello > > > > > > Oh strange. > > I've just loaded Safari V5.01 (7533.17.8) and got the same issue. > White hello in a black banner. White remainder of page. > > Right click and choose inspect, background is now all black as expected. > > Works fine in Chrome V6.0.472.36 beta, IE 8 and FireFox V3.6.8 > > > -- > Richard Quadling. > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > prototype-scriptacul...@googlegroups.com. > To unsubscribe from this group, send email to > prototype-scriptaculous+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] scriptaculous causes body background to fail on safari and chrome
On 17 August 2010 16:13, Guillaume Lepicard wrote: > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml";> > > BG fail > > body { > background-color: #00; > color:#ff; > } > > > > > > Hello > > Oh strange. I've just loaded Safari V5.01 (7533.17.8) and got the same issue. White hello in a black banner. White remainder of page. Right click and choose inspect, background is now all black as expected. Works fine in Chrome V6.0.472.36 beta, IE 8 and FireFox V3.6.8 -- Richard Quadling. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: 4 different browsers - 4 different responses
I don't see how this went too far afield at all -- at least not nearly enough to bother to comment on it. Richard had some Prototype-related code that wasn't doing what he wanted and he also mentioned the target attribute not being "standards" and so not wanting to use it. I told him how I do what he's doing (with Prototype) and asked in what way he thought `target` wasn't standard. He answered me. Hardly a digression worth commenting on. Sometimes discussions do start out related to Prototype and then branch a bit into general web development (much more than this one did), which I don't see as using the list incorrectly at all. A question that didn't involve Prototype or scripty *at all* would be off-topic. -- T.J. On Aug 17, 7:32 am, Lapis wrote: > Oh hai ;) > > Interesting as it may be.. > does prototype.js or scriptaculous have anything to do Witherspoon > this? Or did I just subscribe to some random HTML/HTTP chat? > > Sorry, getting morning coffee now... > > /P > > On 13 Aug, 17:06, Richard Quadling wrote: > > > > > Hi. > > > I want to press a button to open a new tab showing a PDF file. > > > Currently, I have ... > > > > class="formButtons"> > > View jobsheet > > > > > and each browser resulted in a different outcome (Chrome:new tab OK, > > Firefox:2 new tabs both OK, IE:nothing, Safari:new window) > > > I know that target is a no-no for standards (and it seems IE is the > > only one obeying it this time around!). > > > So. > > > How do I do this? The real url is supplied at runtime via an AJAX > > request. I can assign it to whatever is needed. > > > I could just style the as a button ... is that possible? > > > Any suggestions? > > > Regards, > > > Richard Quadling. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] scriptaculous causes body background to fail on safari and chrome
Hi all, i have a very simple document: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml";> BG fail body { background-color: #00; color:#ff; } Hello On chrome and safari, the black background stops right after the h1 hello. On safari, if i ask for the page source code, right after the code window appeared, the background gets back to normal. If i remove scriptaculous inclusion, no more problem. If i move the style declaration after the script tags, no more problem (it took really long to figure out what went wrong...). Am i missing something? is it recommended to move the style declarations (or imports i tested with external css) after scripts? is it a safari and chrome (webkit?) bug? Thanks Guillaume -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Safari problem in Accordion with Flash content
Can anyone explain why I might see the following? I have a simple Accordion effect made with Scriptaculous: var tog = function(){ var params = {duration:0.2}; if (this.next('p')) { Effect.toggle(this.next('p'),'blind',params); }else{ if(this.up().next('p')){ Effect.toggle(this.up().next('p'),'blind',params); } } }; It works fine in all browsers. But while watching the page in Safari's error console, and clicking the header over a Flash movie, I see an incrementing error related to the Flash movie itself: "Failed to load resource: cancelled". If I open and close the accordion effect, hiding and showing the Flash movie, the page works perfectly, but that error repeats every time after the first time the movie shows. The other header on the page reveals a static JPEG image, and nothing happens in the console when that opens and closes. Here's a live example, extracted from my Rails project, if you want to see it in the wild. http://scripty.walterdavisstudio.com/problem Thanks, Walter -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Appending a template evaluation to an HTML element.
I would think that Creating elements is less limiting... but I have no idea what most developers do. On Tue, Aug 17, 2010 at 8:29 AM, Richard Quadling wrote: > On 17 August 2010 12:59, Phil Petree wrote: > > === > > HTML save as index.html: > > > > > > > > > > > > > > > > Keyword > > > > > > > > > > > > > > > > var nextkeyid = 2; > > function addkeyword() > > { > > var elTR = $('keytable').insertRow( -1 ); > > var elTitleTD = elTR.insertCell( -1 ); > > elTitleTD.appendChild( document.createTextNode( 'Keyword' ) ); > > var elInput = document.createElement( 'input' ); > > elInput.type = 'text'; > > elInput.name = 'keyword_'+nextkeyid; > > nextkeyid++; > > var elInputTD = elTR.insertCell( -1 ); > > elInputTD.appendChild( elInput ); > > } > > function dosubmit( ) { > > new Ajax.Updater( 'result', 'add.php', { method: 'post', parameters: > > $('myform').serialize() } ); > > } > > > > > > > > === > > Serverside PHP save as add.php: > > > > Post Result: > > > > === > > On Tue, Aug 17, 2010 at 7:30 AM, Richard Quadling > > wrote: > >> > >> On 17 August 2010 12:01, Phil Petree wrote: > >> > That's in the expando example that comes with prototype.js 1.6x > >> > > >> > On Tue, Aug 17, 2010 at 6:35 AM, Richard Quadling < > rquadl...@gmail.com> > >> > wrote: > >> >> > >> >> Hi. > >> >> > >> >> I've implemented a simple "add new user" button to my "amend users" > >> >> page. The user list is only about 20 people, with > >> >> name/email/pin/contracts/delete options. > >> >> > >> >> The button calls a template evaluation and that is within an update > ... > >> >> > >> >> $('vsNewUsers').update($('vsNewUsers').innerHTML + > >> >> tmpl_NewUser.evaluate({NewUserID : --i_NewUserID})); > >> >> > >> >> All working fine. > >> >> > >> >> I like how it works, but I wonder how I can just append the result of > >> >> the evaluation. > >> >> > >> >> How do I take a template and append the results to vsNewUsers. > >> >> vsNewUsers is a tbody element and the template is a element with > >> >> all the 's needed. > >> >> > >> >> var tmpl_NewUser = new Template(' >> >> name="User[#{NewUserID}][Username]" value="" maxlength="200" > size="50" > >> >> /> >> >> value="" maxlength="200" size="50" /> >> >> name="User[#{NewUserID}][PIN]" value="" maxlength="4" > >> >> /> >> >> name="User[#{NewUserID}][AllContracts]" value="1" > >> >> id="allContracts_#{NewUserID}" /> >> >> name="User[#{NewUserID}][ContactIDs]" value="" maxlength="200" > >> >> disabled="disabled" size="50" /> >> >> name="User[#{NewUserID}][ContactIDs]" value=""> >> >> class="vsaChooseContracts bold" > >> >> id="selectContracts_#{NewUserID}">Select > >> >> contracts >> >> name="User[#{NewUserID}][Delete]" value="#{NewUserID}" > />'); > >> >> > >> >> I'm thinking no. > >> >> > >> >> Regards, > >> >> > >> >> Richard. > >> >> > >> >> -- > >> >> Richard Quadling. > >> >> > >> >> -- > >> >> You received this message because you are subscribed to the Google > >> >> Groups > >> >> "Prototype & script.aculo.us" group. > >> >> To post to this group, send email to > >> >> prototype-scriptacul...@googlegroups.com. > >> >> To unsubscribe from this group, send email to > >> >> prototype-scriptaculous+unsubscr...@googlegroups.com > . > >> >> For more options, visit this group at > >> >> http://groups.google.com/group/prototype-scriptaculous?hl=en. > >> >> > >> > > >> > -- > >> > You received this message because you are subscribed to the Google > >> > Groups > >> > "Prototype & script.aculo.us" group. > >> > To post to this group, send email to > >> > prototype-scriptacul...@googlegroups.com. > >> > To unsubscribe from this group, send email to > >> > prototype-scriptaculous+unsubscr...@googlegroups.com > . > >> > For more options, visit this group at > >> > http://groups.google.com/group/prototype-scriptaculous?hl=en. > >> > > >> > >> Can you point me to the URL please? > >> > >> -- > >> Richard Quadling. > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "Prototype & script.aculo.us" group. > >> To post to this group, send email to > >> prototype-scriptacul...@googlegroups.com. > >> To unsubscribe from this group, send email to > >> prototype-scriptaculous+unsubscr...@googlegroups.com > . > >> For more options, visit this group at > >> http://groups.google.com/group/prototype-scriptaculous?hl=en. > >> > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Prototype & script.aculo.us" group. > > To post to this group, send email to > > prototype-scriptacul...@googlegroups.com. > > To unsubscribe from this group, send email to > > prototype-scriptaculous+unsubscr...@googlegroups.com > . > > For more options, visit this group at > > http://groups.google.com/group/prototype-scriptaculous?hl=en. > >
Re: [Proto-Scripty] Appending a template evaluation to an HTML element.
On 17 August 2010 12:59, Phil Petree wrote: > === > HTML save as index.html: > > > > > > > > Keyword > > > > > > > > var nextkeyid = 2; > function addkeyword() > { > var elTR = $('keytable').insertRow( -1 ); > var elTitleTD = elTR.insertCell( -1 ); > elTitleTD.appendChild( document.createTextNode( 'Keyword' ) ); > var elInput = document.createElement( 'input' ); > elInput.type = 'text'; > elInput.name = 'keyword_'+nextkeyid; > nextkeyid++; > var elInputTD = elTR.insertCell( -1 ); > elInputTD.appendChild( elInput ); > } > function dosubmit( ) { > new Ajax.Updater( 'result', 'add.php', { method: 'post', parameters: > $('myform').serialize() } ); > } > > > > === > Serverside PHP save as add.php: > > Post Result: > > === > On Tue, Aug 17, 2010 at 7:30 AM, Richard Quadling > wrote: >> >> On 17 August 2010 12:01, Phil Petree wrote: >> > That's in the expando example that comes with prototype.js 1.6x >> > >> > On Tue, Aug 17, 2010 at 6:35 AM, Richard Quadling >> > wrote: >> >> >> >> Hi. >> >> >> >> I've implemented a simple "add new user" button to my "amend users" >> >> page. The user list is only about 20 people, with >> >> name/email/pin/contracts/delete options. >> >> >> >> The button calls a template evaluation and that is within an update ... >> >> >> >> $('vsNewUsers').update($('vsNewUsers').innerHTML + >> >> tmpl_NewUser.evaluate({NewUserID : --i_NewUserID})); >> >> >> >> All working fine. >> >> >> >> I like how it works, but I wonder how I can just append the result of >> >> the evaluation. >> >> >> >> How do I take a template and append the results to vsNewUsers. >> >> vsNewUsers is a tbody element and the template is a element with >> >> all the 's needed. >> >> >> >> var tmpl_NewUser = new Template('> >> name="User[#{NewUserID}][Username]" value="" maxlength="200" size="50" >> >> />> >> value="" maxlength="200" size="50" />> >> name="User[#{NewUserID}][PIN]" value="" maxlength="4" >> >> />> >> name="User[#{NewUserID}][AllContracts]" value="1" >> >> id="allContracts_#{NewUserID}" />> >> name="User[#{NewUserID}][ContactIDs]" value="" maxlength="200" >> >> disabled="disabled" size="50" />> >> name="User[#{NewUserID}][ContactIDs]" value="">> >> class="vsaChooseContracts bold" >> >> id="selectContracts_#{NewUserID}">Select >> >> contracts> >> name="User[#{NewUserID}][Delete]" value="#{NewUserID}" />'); >> >> >> >> I'm thinking no. >> >> >> >> Regards, >> >> >> >> Richard. >> >> >> >> -- >> >> Richard Quadling. >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> >> Groups >> >> "Prototype & script.aculo.us" group. >> >> To post to this group, send email to >> >> prototype-scriptacul...@googlegroups.com. >> >> To unsubscribe from this group, send email to >> >> prototype-scriptaculous+unsubscr...@googlegroups.com. >> >> For more options, visit this group at >> >> http://groups.google.com/group/prototype-scriptaculous?hl=en. >> >> >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "Prototype & script.aculo.us" group. >> > To post to this group, send email to >> > prototype-scriptacul...@googlegroups.com. >> > To unsubscribe from this group, send email to >> > prototype-scriptaculous+unsubscr...@googlegroups.com. >> > For more options, visit this group at >> > http://groups.google.com/group/prototype-scriptaculous?hl=en. >> > >> >> Can you point me to the URL please? >> >> -- >> Richard Quadling. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Prototype & script.aculo.us" group. >> To post to this group, send email to >> prototype-scriptacul...@googlegroups.com. >> To unsubscribe from this group, send email to >> prototype-scriptaculous+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/prototype-scriptaculous?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > prototype-scriptacul...@googlegroups.com. > To unsubscribe from this group, send email to > prototype-scriptaculous+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > Now in comparison, that process (creating elements, assigning properties, etc.) _LOOKS_ a lot more effort. What do most developers do? Templates or createElement? -- Richard Quadling. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options
Re: [Proto-Scripty] Appending a template evaluation to an HTML element.
=== HTML save as index.html: Keyword var nextkeyid = 2; function addkeyword() { var elTR = $('keytable').insertRow( -1 ); var elTitleTD = elTR.insertCell( -1 ); elTitleTD.appendChild( document.createTextNode( 'Keyword' ) ); var elInput = document.createElement( 'input' ); elInput.type = 'text'; elInput.name = 'keyword_'+nextkeyid; nextkeyid++; var elInputTD = elTR.insertCell( -1 ); elInputTD.appendChild( elInput ); } function dosubmit( ) { new Ajax.Updater( 'result', 'add.php', { method: 'post', parameters: $('myform').serialize() } ); } === Serverside PHP save as add.php: Post Result: === On Tue, Aug 17, 2010 at 7:30 AM, Richard Quadling wrote: > On 17 August 2010 12:01, Phil Petree wrote: > > That's in the expando example that comes with prototype.js 1.6x > > > > On Tue, Aug 17, 2010 at 6:35 AM, Richard Quadling > > wrote: > >> > >> Hi. > >> > >> I've implemented a simple "add new user" button to my "amend users" > >> page. The user list is only about 20 people, with > >> name/email/pin/contracts/delete options. > >> > >> The button calls a template evaluation and that is within an update ... > >> > >> $('vsNewUsers').update($('vsNewUsers').innerHTML + > >> tmpl_NewUser.evaluate({NewUserID : --i_NewUserID})); > >> > >> All working fine. > >> > >> I like how it works, but I wonder how I can just append the result of > >> the evaluation. > >> > >> How do I take a template and append the results to vsNewUsers. > >> vsNewUsers is a tbody element and the template is a element with > >> all the 's needed. > >> > >> var tmpl_NewUser = new Template(' >> name="User[#{NewUserID}][Username]" value="" maxlength="200" size="50" > >> /> >> value="" maxlength="200" size="50" /> >> name="User[#{NewUserID}][PIN]" value="" maxlength="4" > >> /> >> name="User[#{NewUserID}][AllContracts]" value="1" > >> id="allContracts_#{NewUserID}" /> >> name="User[#{NewUserID}][ContactIDs]" value="" maxlength="200" > >> disabled="disabled" size="50" /> >> name="User[#{NewUserID}][ContactIDs]" value=""> >> class="vsaChooseContracts bold" > >> id="selectContracts_#{NewUserID}">Select > >> contracts >> name="User[#{NewUserID}][Delete]" value="#{NewUserID}" />'); > >> > >> I'm thinking no. > >> > >> Regards, > >> > >> Richard. > >> > >> -- > >> Richard Quadling. > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "Prototype & script.aculo.us" group. > >> To post to this group, send email to > >> prototype-scriptacul...@googlegroups.com. > >> To unsubscribe from this group, send email to > >> prototype-scriptaculous+unsubscr...@googlegroups.com > . > >> For more options, visit this group at > >> http://groups.google.com/group/prototype-scriptaculous?hl=en. > >> > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Prototype & script.aculo.us" group. > > To post to this group, send email to > > prototype-scriptacul...@googlegroups.com. > > To unsubscribe from this group, send email to > > prototype-scriptaculous+unsubscr...@googlegroups.com > . > > For more options, visit this group at > > http://groups.google.com/group/prototype-scriptaculous?hl=en. > > > > Can you point me to the URL please? > > -- > Richard Quadling. > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > prototype-scriptacul...@googlegroups.com. > To unsubscribe from this group, send email to > prototype-scriptaculous+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Appending a template evaluation to an HTML element.
On 17 August 2010 12:01, Phil Petree wrote: > That's in the expando example that comes with prototype.js 1.6x > > On Tue, Aug 17, 2010 at 6:35 AM, Richard Quadling > wrote: >> >> Hi. >> >> I've implemented a simple "add new user" button to my "amend users" >> page. The user list is only about 20 people, with >> name/email/pin/contracts/delete options. >> >> The button calls a template evaluation and that is within an update ... >> >> $('vsNewUsers').update($('vsNewUsers').innerHTML + >> tmpl_NewUser.evaluate({NewUserID : --i_NewUserID})); >> >> All working fine. >> >> I like how it works, but I wonder how I can just append the result of >> the evaluation. >> >> How do I take a template and append the results to vsNewUsers. >> vsNewUsers is a tbody element and the template is a element with >> all the 's needed. >> >> var tmpl_NewUser = new Template('> name="User[#{NewUserID}][Username]" value="" maxlength="200" size="50" >> />> value="" maxlength="200" size="50" />> name="User[#{NewUserID}][PIN]" value="" maxlength="4" >> />> name="User[#{NewUserID}][AllContracts]" value="1" >> id="allContracts_#{NewUserID}" />> name="User[#{NewUserID}][ContactIDs]" value="" maxlength="200" >> disabled="disabled" size="50" />> name="User[#{NewUserID}][ContactIDs]" value="">> class="vsaChooseContracts bold" >> id="selectContracts_#{NewUserID}">Select >> contracts> name="User[#{NewUserID}][Delete]" value="#{NewUserID}" />'); >> >> I'm thinking no. >> >> Regards, >> >> Richard. >> >> -- >> Richard Quadling. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Prototype & script.aculo.us" group. >> To post to this group, send email to >> prototype-scriptacul...@googlegroups.com. >> To unsubscribe from this group, send email to >> prototype-scriptaculous+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/prototype-scriptaculous?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > prototype-scriptacul...@googlegroups.com. > To unsubscribe from this group, send email to > prototype-scriptaculous+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > Can you point me to the URL please? -- Richard Quadling. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] Appending a template evaluation to an HTML element.
That's in the expando example that comes with prototype.js 1.6x On Tue, Aug 17, 2010 at 6:35 AM, Richard Quadling wrote: > Hi. > > I've implemented a simple "add new user" button to my "amend users" > page. The user list is only about 20 people, with > name/email/pin/contracts/delete options. > > The button calls a template evaluation and that is within an update ... > > $('vsNewUsers').update($('vsNewUsers').innerHTML + > tmpl_NewUser.evaluate({NewUserID : --i_NewUserID})); > > All working fine. > > I like how it works, but I wonder how I can just append the result of > the evaluation. > > How do I take a template and append the results to vsNewUsers. > vsNewUsers is a tbody element and the template is a element with > all the 's needed. > > var tmpl_NewUser = new Template(' name="User[#{NewUserID}][Username]" value="" maxlength="200" size="50" > /> value="" maxlength="200" size="50" /> name="User[#{NewUserID}][PIN]" value="" maxlength="4" > /> name="User[#{NewUserID}][AllContracts]" value="1" > id="allContracts_#{NewUserID}" /> name="User[#{NewUserID}][ContactIDs]" value="" maxlength="200" > disabled="disabled" size="50" /> name="User[#{NewUserID}][ContactIDs]" value=""> class="vsaChooseContracts bold" > id="selectContracts_#{NewUserID}">Select > contracts name="User[#{NewUserID}][Delete]" value="#{NewUserID}" />'); > > I'm thinking no. > > Regards, > > Richard. > > -- > Richard Quadling. > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > prototype-scriptacul...@googlegroups.com. > To unsubscribe from this group, send email to > prototype-scriptaculous+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Appending a template evaluation to an HTML element.
Hi. I've implemented a simple "add new user" button to my "amend users" page. The user list is only about 20 people, with name/email/pin/contracts/delete options. The button calls a template evaluation and that is within an update ... $('vsNewUsers').update($('vsNewUsers').innerHTML + tmpl_NewUser.evaluate({NewUserID : --i_NewUserID})); All working fine. I like how it works, but I wonder how I can just append the result of the evaluation. How do I take a template and append the results to vsNewUsers. vsNewUsers is a tbody element and the template is a element with all the 's needed. var tmpl_NewUser = new Template('Select contracts'); I'm thinking no. Regards, Richard. -- Richard Quadling. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[OT] Use the list properly. Please [WAS] Re: [Proto-Scripty] Re: 4 different browsers - 4 different responses
On 17 August 2010 07:32, Lapis wrote: > Oh hai ;) > > Interesting as it may be.. > does prototype.js or scriptaculous have anything to do Witherspoon > this? Or did I just subscribe to some random HTML/HTTP chat? > > Sorry, getting morning coffee now... > > /P No, you are right. I sometimes think that everything I do on the client side is to do with Prototype. The same argument was just raised at http://news.php.net/php.db/47310, so it isn't just this list that suffers from subscribers having a mental block on the reason for the list's existence. Please accept my apologies. As my school reports always said ... "Could try harder.". Richard. -- Richard Quadling. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.