dojo

dojo 学习日记 之 数组操作

痞子三分冷 提交于 2019-11-26 22:17:06
dojo 对Javascript1.6 的数组操作功能进行了拓展: clearCache () every (arr, callback, thisObject) Determines whether or not every item in arr satisfies the condition implemented by callback. filter (arr, callback, thisObject) Returns a new Array with those items from arr that match the condition implemented by callback. forEach (arr, callback, thisObject) for every item in arr, callback is invoked. indexOf (arr, value, fromIndex, findLast) locates the first index of the provided value in the passed array. lastIndexOf (arr, value, fromIndex) locates the last index of the provided value in the passed array. map

Get Query String with Dojo

不想你离开。 提交于 2019-11-26 21:40:13
问题 Users will be hitting up against a URL that contains a query string called inquirytype . For a number of reasons, I need to read in this query string with javascript (Dojo) and save its value to a variable. I've done a fair amount of research trying to find how to do this, and I've discovered a few possibilities, but none of them seem to actually read in a query string that isn't hard-coded somewhere in the script. 回答1: You can access parameters from the url using location.search without Dojo

Struts2 .action extension causing CSS, JavaScript and Struts Dojo to break

风格不统一 提交于 2019-11-26 21:02:09
We have been running on Struts 2.1.8 for some time and all Struts actions have been working as expected, i.e. href's to the Struts actions are rendered with the action name with no extension. Here is the JSP code that set's up the links: <ul id="top_menu"> <li id="itemHome" class="active"><s:a action="viewHome">Home</s:a></li> <li><s:a action="viewSearch">Search</s:a></li> <li><s:a action="viewBookMarks">My Bookmarks</s:a></li> <li><s:a action="viewSupport">Support</s:a></li> </ul> The links rendered correctly to http://localhost/viewHome , http://localhost/viewSearch , etc. under 2.1.8 We

JavaScript simulate right click through code

谁都会走 提交于 2019-11-26 20:09:00
I am writing some UI tests using Selenium and i have a JavaScript Tree control, using the Dojo toolkit. I have implemented a context menu for each node of the tree using the examples that Dojo provide, but I need the Selenium test to "invoke" the right click on the tree node, but I cannot get this to work. The tests simply do not simulate the right-click event through JavaScript, and the context menu does not show up. Has anyone had any experience in invoking the right click on a context menu using Dojo and Selenium? Or have any ideas as to how to do it? try this instead, reason what things

Selenium WebDriver - determine if element is clickable (i.e. not obscured by dojo modal lightbox)

北城以北 提交于 2019-11-26 17:10:48
问题 I write automated scripts for testing web applications that are very heavy on ajax. For example, a modal dialog is displayed with the text " Saving... " when saving settings, while a lightbox greys out the rest of the page. My test scripts are trying to click the next link in the test before the message disappears. It almost always works when driving Firefox, but when driving Chrome the following error is displayed: Exception in thread "main" org.openqa.selenium.WebDriverException: Element is

mootools,jquery,dojo

自作多情 提交于 2019-11-26 16:28:43
最近,我开始关注Dojo了,Dojo是一个强大的面向对象JavaScript框架,既然我那么喜欢MooTools,也没理由不喜欢Dojo。与Dojo相比我对MooTools 和 jQuery 是比较熟的。这并不重要,不管使用什么样的语言,我们完成的任务是相同的,本质上的区别是使用的语法不同罢了。 接下来,我就来看一些不同JavaScript框架,如何使用一些基本的语法,来完成共同任务。 Execute Code when the DOM is Ready / window.load注册事件的替代方法 The Dojo Toolkit : 1 2 3 dojo.ready(function() {//do stuff}); The jQuery : 1 2 3 jQuery(document).ready(function() {//do stuff}); The MooTools : 1 2 3 window.addEvent('domready',function() {//do stuff}); Elements Style / 设置元素的样式 The Dojo Toolkit : 1 2 dojo.byId('myElement').style('background', 'blue');dojo.query('#id, .class, div').style(

Resolving spring:messages in javascript for i18n internationalization

我与影子孤独终老i 提交于 2019-11-26 15:41:30
问题 I'm attempting to internationalize some of our code. I have a page in JSPX which is using the <spring:message> tag to resolve strings from a message.properties file. This works fine for the HTML and CSS that is in the JSPX page, however there a javascript file is sourced, and substituting the <spring:message> tag for the string in there just means that it gets printed out verbatim. My JSPX sources the javascript like so: <spring:theme code="jsFile" var="js" /> <script type="text/javascript"

创建 Dojo 部件简介

和自甴很熟 提交于 2019-11-26 12:20:54
翻译 https://github.com/dojo/framework/blob/master/docs/en/creating-widgets/introduction.md Dojo 鼓励编写简单的、模块化组件,并称之为 部件 ,它仅实现应用程序大量需求中的单一职责。部件被设计成可在各种场景中组合和复用,能以响应的方式连接在一起,以满足更复杂的 web 应用程序需求。 部件使用渲染函数返回的虚拟节点描述其预期的结构。然后,在应用程序运行时,Dojo 的渲染系统会持续地将部件每一层渲染的内容转换为对应的、高效的 DOM 更新。 功能 描述 响应式设计 Dojo 部件是围绕响应式的核心原则设计的,这样在应用程序中传播变化的状态时,就可以确保可预见的、一致的行为。 封装部件 创建独立、封装的部件,这些部件可通过各种配置组合在一起,从而创建出复杂且漂亮的用户界面。 DOM 抽象 框架提供了恰当的抽象,这意味着 Dojo 应用程序不需要直接与命令式 DOM 打交道。 高效渲染 Dojo 的渲染系统可以检测出部件层次结构中特定子节点的状态变化,这样当更新发生时,只需要高效的重新渲染应用程序中受影响的部分。 企业级 跨领域的应用程序需求,如国际化、本地化和样式主题,可以轻松地添加到用户创建的部件中。 基本用法 定义部件 使用 内置的 create() 将部件定义为一个渲染函数

Worklight core-web-layer.js errors

时间秒杀一切 提交于 2019-11-26 11:40:57
问题 Can someone help me? When I run my Worklight project on Chrome, Firefox or Opera I don\'t get any errors. But when I run it on IE I get these errors: Error: multipleDefine Error: multipleDefine Error: multipleDefine Error: multipleDefine SCRIPT5002: Function expected core-web-layer.js, line 311 character 160 SCRIPT438: Object doesn\'t support property or method \'_eventHandler\' core-web-layer.js, line 165 character 71 When I run it on Android, the Dojo functionality also doesn\'t work and I