yui

Weird browser / ajax error : Extra junk appears at the end of javascript files in firefox

五迷三道 提交于 2019-12-13 06:18:34
问题 This is a weird one. We're writing a Django application with some rich javascript UI, using both Yahoo YUI and jQuery. Our main page template now includes a fair number of js files. And we're starting to see a strange error in Firefox (3 and 3.5) . Sometimes the javascript crashes. And inspecting in Firebug we see that a syntax error occurred in one of the YUI .js files. When we look at the line in Firebug, we see that it's actually a line that doesn't exist in the original file, but seems to

YUI DataTable using KnockoutJS bindings

时间秒杀一切 提交于 2019-12-13 06:07:44
问题 I have an example working at JSFiddle. It has a piece of JSON consumed by a YUI DataTable which I need to create using KnockoutJS bindings. I'm fairly new to KnockoutJS and would like to know how this can be done. The table should be created under the markup - <div class="yui3-skin-sam" id="datatable"></div>​ The code goes as below - YUI().use('datatable', 'datasource-local', 'datasource-jsonschema',function(Y){ var data = {"generations": [{ "type": "Modern", "showName": "The Modern

YUI 2.5. Populating a dropdown from XML

你离开我真会死。 提交于 2019-12-13 05:07:20
问题 Currently editing an application built using YUI 2.5 and Perl. I need to populate a dropdown from an xml file, and only specific rows are to be used depending on the attributes of the node. Unfortunately, there isn't the DropdownCellEditor widget in YUI 2.5 (as far as I'm aware, this didn't come in until 2.6(?)). Does anyone have any ideas? I'm thinking I should probably just update YUI as there seems to be a lot of useful functionality missing in this very old version. The code the original

How Gzip in Tomcat works

空扰寡人 提交于 2019-12-13 02:18:06
问题 I am doing issues about script compression. Following is what I just found in stackoverflow: "If you are using it in a webpage, gzip is a configuration method in your web server. The file is gzipped by the server, sent to the browser. No manual action is needed. For Apache: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html. If you are delivering the code to developers, you could use the gzip command." Someone told me that if such script compression strategy is used, it will make you very

What is a good yui replacement for jquery.live

浪尽此生 提交于 2019-12-12 16:15:34
问题 jQuery.live Added in jQuery 1.3: Binds a handler to an event (like click) for all current - and future - matched element. Can also bind custom events. http://docs.jquery.com/Events/live Is there a good YUI replacement which can do this? 回答1: In YUI3, delegates perform this function. The following snippet will fire a method called "clickHandler" on any 'p' tag in the body. YUI().use('event', function(Y) { Y.delegate("click", clickHandler, "body", "p"); }); YUI 2.8.0 has delegate functionality

Create HTML element with YUI

萝らか妹 提交于 2019-12-12 13:47:08
问题 I am using following code to create a html element in the page body with using YUI. This code doesn't produce any error. The issue is, the paragraph element is not created in the html page. <html> <head> <title>YUI Test</title> <meta charset="UTF-8"> <script src="http://yui.yahooapis.com/3.14.1/build/yui/yui-min.js"></script> <script> // Create a YUI sandbox on your page. YUI().use('node', function(Y) { // Create DOM nodes. var contentNode = Y.Node.create('<p>'); contentNode.setHTML('This is

can't change body background color using CSS reset

拥有回忆 提交于 2019-12-12 12:28:04
问题 Here is my HTML code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Hover Zoom</title> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.3.0/build/cssreset/reset-min.css"> <link rel="stylesheet" type="text/css" href="style.css"> <meta http-equiv="content-type" content="text/html;charset=UTF-8" > </head> <body> </body> </html> Here is my CSS file code ( style.css ): body { background-color:

YUI Button initiates Postback Twice

你说的曾经没有我的故事 提交于 2019-12-12 10:15:50
问题 I'm using ASP.NET 2.0 under VS 2005. Page_Load is getting called twice for my .aspx pages. AutoEventWireup is set to true , but even if I set it to false and manually add the EventHandler , it still gets fired twice. // also set AutoEventWireup to false public _Default() { this.Load += new EventHander(this.Page_Load); } // oops -- fired twice In the Default.aspx page, after the user enters their username & password, I do a redirect to another page, but it seems to redirect back to the Default

Which tools does jQuery use to compress its source code

时光怂恿深爱的人放手 提交于 2019-12-12 10:05:10
问题 Which tools does jQuery use to compress its source code in version 1.6.2? 回答1: It uses UglifyJS. Previously (until 1.4) they used Packer. https://github.com/jquery/jquery/blob/master/Makefile#L9 回答2: I'm not sure, but I find this (minifyjavascript.com) useful, dunno if it helps. 来源: https://stackoverflow.com/questions/6608079/which-tools-does-jquery-use-to-compress-its-source-code

JavaScript YUI3 using global variables?

别等时光非礼了梦想. 提交于 2019-12-12 09:46:39
问题 I can't work out how to update a global variable from within YUI3. Consider the following code: window.myVariable = 'data-one'; var yuiWrap = YUI().use('node',function(Y) { console.log(window.myVariable); // 'data-one' window.myVariable = 'data-two'; console.log(window.myVariable); // 'data-two' }); console.log(window.myVariable); // 'data-one' Can anyone explain this to me? It's causing me a lot of trouble. Why can window.myVariable be accessed but not properly updated from within a YUI3