javascript

ASP.NET MVC and SQL Server

I am new to ASP.NET and the MVC framework as well, so I'd love it if someone could recommend and/or show me some examples of code on how to best read a table from a database and store it as json. The goal after that is to receive some query filter options from a javascript, and then output the json-ified table back to the javascript. Th...

jQuery equivalent of JavaScript's addEventListener method

I'm trying to find the jQuery equivalent of this JavaScript method call: document.addEventListener('click', select_element, true); I've gotten as far as: $(document).click(select_element); but that doesn't achieve the same result, as the last parameter of the JavaScript method - a boolean that indicates whether the event handler sh...

Best jQuery slideshow plugin with pause/play/next/prev controls?

I've done my homework - I swear, I've been researching this for a bit. I have found two nice options, each with its own particular problem: Option #1: "Supersized" @ http://buildinternet.com/project/supersized/ The problem is that the images become stretched to essentially become the background-image. I want the images to stay within ...

Binding event handlers to specific elements, using bubbling (JavaScript/jQuery)

I'm working on a project that approximates the functionality of Firebug's inspector tool. That is, when mousing over elements on the page, I'd like to highlight them (by changing their background color), and when they're clicked, I'd like to execute a function that builds a CSS selector that can be used to identify them. However, I've b...

FancyBox resize width

I'm able to resize the height with the $.fancybox.resize(); part, but the width just doesn't update according to the new content. Thoughts? ...

using XPath to find node under a context node does not work (firefox/firebug/javascript)

I want to extract information from a web page. The page has m nodes, which can be found by .evaluate("//div[@class='news']", document, ....). For each of the above nodes, there are 3 nodes inside them. Each of them has different @class selector. And I want to extract these m 3-tuple records. I tried to use .evaluate() function as inst...

custom validation does not seem to get registered.

Hi, Inside a tab, I have a form that is dynamically loaded via ajax. Since the name of the field is dynamic too(e.g. <input name='title1' id='title1', class='tRequired'>), I write a custom validation method inside the "on complete" like this. However, the custom code does not get executed (the alert never pops up) no matter what i try. ...

How to not allow parts of sortable jquery list to move?

I made a sortable list: <ul> <li class="line"><a href="#" class="food">milk</a></li> <li class="line"><a href="#" class="food">eggs</a></li> <li class="line"><a href="#" class="food">cheese</a></li> </ul> However, I want to make everything with class food not draggable. Since they are links, sometimes when people click them, ...

Javascript: How to simulate cursor with arrow key control for positioning DOM edits?

I'm building an in-browser IDE using Javascript. The code/widgets are stored in the document. I want control over the editing process so I am intercepting keystrokes and displaying a simulated cursor where the edit point is in the DOM. (At first I tried using contenteditable = true but that isn't giving me enough control.) I've made s...

What is wrong with the JavaScript event handling in this example? (Using click() and hover() jQuery methods)

I'm working on a sort of proof-of-concept for a project that approximates Firebug's inspector tool. For more details, please see this related question. Here is the example page. I've only tested it in Firefox: http://troy.onespot.com/static/highlight.html The idea is that, when you're mousing over any element that can contain text, it...

Disable auto resize flash object when opening in IE

If open yahoo finance chart (link pasted below) in IE, the chart will be resized to fit the viewing window, and making the chart viewable without scrolling down. However, this makes the chart become smaller for me. I would like to see original size, which requires me to click the setting bar and change something to make it restore origin...

How to extract a specific input field value from external webpage using Javascript

Hi, i get the webpage content from an external website using ajax but now i want a function which extract a specific input field value which is already autofilled. the webpage content is like this: ......... <input name="fullname" id="fullname" size="20" value="David Smith" type="text"> <input name="age" id="age" size="2" value="32" ty...

Do I need to know good javascript in order to use jquery?

I do not know javascript right now but I am planning on learning it. My question is do I need to have a good understanding of javascript in order to use jquery? I already know actionscript and php which are quite similar. Should I study javascript before learning jquery? ...

How to pass arguments to YUI3's 'on' method callbacks?

I have 2 event handlers: Y.all(".ptl").on("mouseover", handleOverlay); Y.all(".ptl").on("mouseout", handleOverlay); And I would like to pass an arugment to handleOverlay on mouseout so that the function knows that the user has exited the node and to exit the handleOverlay function. I have attemped to follow the API http://developer...

Help! Ajax not getting an external page content?

Hi, I want to extract the source code of a webpage which is hosted by other website, but the problem is that O get an empty response, I tried to pull the source of multiple websites but the problem is from my code: $(document).ready(function(){ $.get('http://www.xxxx.com', function(xdata) { alert("content: "+xdata); });...

Loading Facebook ActionScript library in an HTML Adobe AIR app

I'm writing an Adobe AIR app using plain HTML which needs to upload photos to Facebook. I don't think Facebook's JavaScript/Connect library includes photo uploading functionality, but their ActionScript library does. However, I'm having trouble loading the ActionScript library into the HTML page. Adobe's documentation describes the proc...

event for textbox update

I have a textbox and want an event triggered whenever it is updated, whether through key presses, pasted from clipboard, or whatever else is possible. Is binding to the keyup event sufficient or is there a better way? ...

html script tag

Hi, Why doesn't this work <script src="jquery.js"/> But this works <script src="jquery.js"></script> ? Firefox 3.5.8 ...

How to implement a function which add a click option for border when mouseover a flash?

I want implement a function for my extension of Firefox. and when my mouse over a flash or other objects in a web,a border will show and around this flash, and up the border is a tab we can click it to invoke a App, just like Thunder extension , now I have implement showing a border around flash ,but How to add a tab on border to invoke ...

BIRT logging in the onFetch step of a dataset

Hi all, Im having trouble with some javascript in the onFetch step of a dataset in a BIRT report. I've added logging in the initialise step of the report in a few different ways. The runtime im using is Tivoli Common Reporting, and they supply a logging framework. Its initialised as so reportContext.setPersistentGlobalVariable("logfil...