javascript

What are practical use cases of javascript prototype objects?

How are you using javascript prototype objects in your everyday code? I found it hard to either explain or find use cases for it. Purpose driven examples and pseudo code examples would be great - thanks! ...

Chrome V8 Bug? Function Acting different after being called a 2nd time.

Please take a look at the following JavaScript. I've taken stuff out of it, so you may focus on the essence of the problem. You'll notice that I call the prepPath function twice in a row, passing in the exact same string. In firefox and IE8, this function alerts true each time (as expected). But, in Chromium 5.0.375.127 (55887) Ubuntu 1...

How to create in-context editing?

My company is building a CMS. As a front-end web developer, I am asked to build a 'in-context editing' feature. You can see an example here http://www.concrete5.org/documentation/general-topics/in-context-editing/ I want to know what kind of program should we know to build this? Can this be achieved with just JavaScript or some front e...

How to auto select timezone in a web form & correlate it to mysql time zones

In javascript I can get the offset from UTC & whether DST is used by the users timezone. In MySQL I have a set of timezone tables. I'd like to auto select a timezone for the user from the MySQL tables. The mysql tables are not easy to understand (nor can I find schema documentation). I can't figure out how to go from a UTC offset + DS...

Cookies and javascript navigation (tabs)

I have a navigation tabs and when user clicks a tab the div changes with ajax. I would like to it to remember on what tab user was when user changes page. I havent done the tab navigation and im totally new to javascript/jquery. Here is the javascript for the tabs: jQuery('#contentContainer #tabNavi .nav-item').each(function(i, item) {...

What kind of Javascript object is this?

I have a mystery object in Javascript - please could someone tell me how to initialise a similar object? Background: I've inherited some code that gets passed a params object from Flash. I want to 'fake' the same call, which requires manually constructing the same object. But I can't work out how to take it, because I don't know what ty...

Why does a ChromeWorker throw "Components is not defined"

The documentation on ChromeWorkers says that they have "chrome privileges", and chrome privileges are supposed to mean they can do anything, but when I create a ChromeWorker and try to use Components I get an error that 'Components' is not defined.. So my question is 1) why is Components not available? 2) what is available to a ChromeWo...

Joomla Random Image

I have been searching a plugin/module for Joomla where: Loads random image on page refresh Have each image have their own URL Has to work with Joomfish (multilingual) Let me know if you have found any alternative component or module for this type of usability. The reason why I wanna keep it as a module is I want the client to actual...

Pagination page saves page in to cookie

I have a pagination which is done like this: this.pagination = function(limit, length){ //number of pages var nrpages = Math.ceil(length/limit); var currPage = this.pagingcurrPage; console.log('l- '+length); console.log('p- '+nrpages); console.log('c- '+currPage); $.cookie('presss...

positioning pager buttons in jquery cycle

Hello, I am using the jquery cycle on a new website and am having trouble positioning the pager element. Here is the url: http://www.rockymountainsports.ca/web/layout.html in the jquery the #nav element is defined with .before(element) I can change the .before to .after and it positions it about 300px below the box. I would like for t...

JQuery grid with detail tables

I have a grid that is currently using Telerik Grids, I would like to convert this to using all Jquery with JSON. I would like to know what is the best tool to use. FlexiGrid and jQgrid are the top ones on my list although I can not find any examples with FlexiGrid having nested tables (detail tables), which is a must. My question is, wh...

Dojo Grid - Switching between editable and not editable

I have a grid that will edit small chunks of data based on a larger tree structure. In order to make it easier to know what's being saved by the user, I want to have the grid be in a non-editable state when the user first sees the grid. When the user is ready, they can click the edit button, which will make portions of the grid editable....

Using inheritance patterns in JavaScript

From my experiance, JavaScript does this: manipulating the DOM or other host objects adding event handlers doing Ajax Since I started digging into prototypal inheritance, I would like to know how it is actually used in practice. What are the use cases? Is anyone here actively using inheritance patterns? What for? (I understand that...

javascript - calling a javascript addEvent function from a different javascript function

hi. using mootools, and have the follwoing test. the test has an initial function that traps the 'submit' event from the form, so the submit btn invokes the window.addEvent function. this works. i'm trying to figure out how to call the window.addEvent function from a separate javascript function, ie the saveCollegedata function. in lo...

Good javascript widget for streaming data

I have a requirement to show a stream of data via Javascript. Watching an http log file in real-time would be a good example. The data is in fact nested JSON but it could be forced into a table-like structure. The data source would need to be an AJAX call executed periodically (WebSockets would be better but it needs to support non HTML5...

Flex Error flex.messaging.io.amf.ASObject cannot be cast to

Hi, I have an action script Object that contains an array collection of other object, both objects are reflects of the Java Objects which are the database tables represented as beans, i am using blazeds spring hibernate... the regular configurations for flex RIA with java backend server language, all other objects work perfectly, but th...

Fax Number Regular Expression for Javascript

Ok my when I tab into and out of my Fax number field I get a validation error. Is it because of the way the expression is written? ^(1\s*[-\/\.]?)?(\((\d{3})\)|(\d{3}))?\s*[-\/\.]?\s*(\d{3})?\s*[-\/\.]?\s*(\d{4})?$ ...

Quicklinks for Wordpress

Hi All, I have a hard time figuring out what code this website (hotair.com) is using for their quicklinks -- it's the Headline section. I' trying to create the same table layout but with one column. I was using the Minipost plugin, but I figure there must be an easier way to maintain links from feeds, which I can customize the headlin...

Input File field to Input Text field

I don't even know if this is possible or not but is there a method you can take the value of the selected file in a input file field to a input text field? Like this: ...

JqGrid add button to advanced search dialog

I'd like to add the ability to save a complex query built up in the advanced search dialog. Saving the generated SQL is no problem, but I'm not sure how to add buttons to the advanced search query dialog to give users the options of saving / loading a query. Any advice would be appreciated. ...