javascript

How to get the text between the given graphical points ?

Hi. Is there any way to get the text, which lies between two given graphical points on the current page using Javascript? Say, it is given two points p1=(x1,y1) and p2=(x2, y2). How can I get the text which lies between p1 and p2 on the current HTML/web page? My requirement is: When we mousedown on a page and move the mouse, it selec...

How to disable mouse left click?

Hi, I want to disable mouse left click. I use the following script but not work. <h:form> <a4j:commandButton value="TestButton" onclick="alert('button cliked')"/> </h:form> JavaScript is : <script type="text/javascript"> document.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.CLICK); document.onmous...

Passing variable in Javascript

What is wrong with this code? <script type="text/javascript"> var urlquery = location.href; var urlparts = urlquery.split('='); var urlplan = (urlparts[1]); $(document).ready(function() { $('#LDF a').click(function() { $.ajax({ url: 'src/ldf_dpd_list.php?search-n=urlplan', s...

Link outside of an Iframe

Hello, I have links within an iframe that are external, and I would like them to open in the same window, leaving the iframe. Thanks! ...

What is the best way to make the Yahoo media player autostart, jQuery?

Yahoo has a mediaplayer to play media on a webpage: http://mediaplayer.yahoo.com/ but there is no option to make it auto start. What is the best way to make it autostart, by hacking into the code, or it can also be using jQuery to "click" on one of the media to auto start it, although, how do you know the Yahoo code has finish ini...

In javascript functions, can you set this.function = function?

I have run into this jquery plugin and i quite understand how this works: $.functionone = function(){ function setOptions(newOptions){ ... } this.setOptions = setOptions; } What i dont understand is what does this actually do? this.setOptions = setOptions can you call a function without parenthesis? What is the re...

How to get JQuery to accept a JSON reply?

Hi all, Here's some simple Javascript: (function($){ var ajax_callback = function(data) { window.location.hash = data.h1; }; $('.clickable').live('click', function() { $.post('server.fcgi', {}, ajax_callback, 'json'); } ); })(jQuery); The server is a c++ binary (yes, i know) that spits out (through...

how to avoid mouse click after open modalPanel?

Hi, here i prevent to mouse click after open the modalPanel.(Not allow to click buttons, link after open modalpanel etc). But i need to use the following css : rich-mpnl-mask-div <rich:modalPanel id="test_ModalPanel" style="height:200px;width:200px"> <a4j:commandLink value="Hide Me" onclick="javascript:Richfaces....

jQuery's click() is not clicking?

I thought jQuery's click() can let us add a handler or just click on an element? However, I tried: $(function() { setTimeout(function() { $('a').first().trigger('click'); // or click(), the same }, 3000); }); and waited 3 seconds and it won't click on the first element in the ...

Jquery - Truncate Text by Line (not by chart-count)

Dear All, I need a Jquery script to truncate a text paragraph by line (not by chart count). I would like to achieve an evenly truncated text-block. It should have a "more" and "less" link to expand and shorten the text paragraph. My text paragraph is wrapped in a div with a class, like this: <div class="content"> <h2>Headline</h2> <p>...

Suggest Prototype/jQuery Widgets

I am revamping a website that (now) uses Prototype framework. In the process of revamping, I realized that the site was using about 7-8 JavaScript widgets from various sources. I am removing all JavaScript widgets and replacing them with Prototype based counterparts. Can you suggest tried and tested widgets for following functions: Pop...

HTML frames interaction & Javascript: Firefox issue

Hi there, this issue is kinda strange, and happens only in Firefox (v. 3.6.6 but also in older versions of 3.6). The best way to explain it is to describe the scenario, so.. here it is: I have two HTML pages: Page-A & Page-B. Page-A contains an iframe element, which its source points to Page-B. Page-B contains a JavaScript function: f...

jQuery's click() can trigger event handlers only for DOM 0 and event handlers registered through jQuery...?

[Update:] This question is related to: what does jQuery's click() do? http://stackoverflow.com/questions/3130539/jquerys-click-is-not-clicking The following code: <div id="oneDiv"> some content </div> <p> <a href="http://www.google.com" id="clickme">Click Me</a> </p> [ ... ] onload = function() { $('...

Looking for a book flip library/plugin

Hello, I'm looking for a "flip book" effect that works on Ipad, without Flash. Thank you! ...

Stop User from using "Print Scrn" / "Printscreen" key of the Keyboard for any Web Page

I am currently doing a project, in which I need to stop the user from taking the snapshot of any Web Page, for which he can use the "Print Scrn" / "Printscreen" key available in any of the normal keyboards. I have been trying to find its solution, but in vain. If possible, I need to take into account of the "Screengrab" add-on of the Fi...

GreaseMonkey countdown not working?

I'm very confused, with greasemonkey setTimeout just isn't working, it never calls the function, looking online people say greasemonkey doesn't support setTimeout, is there anyway to make my objective (below) work? function countdown(time, id) { if(document.getElementById(id)) { var name = document.getElementById(id); v...

popup window in asp

Can i have a popup window in asp page when i click on a hyperlink? and on that popup can i display my image? plzz help....thanxx... ...

Jquery Plugin Drag & Drop sample

Hello All.... I have a requirements, where I have to implements the drag & drop functionality for end client. From where end - client can drag a table fields in which they are interested. and even remove the dragged field back to the list. It would be great if anybody can provide me some demo link with source code... Thanks in advanc...

ASP.NET: convert plain hyperlink in html hyperlink

Hi folks, anyone know how to "discover" hyperlink in some text and convert that hyperlink in html hyperlink with asp.net (or javascript). For example, if a user enter this text: You found it at http://www.foo.com How can i found and convert in html like : You found it at <a href='http://www.foo.com'&gt;http....&lt;/a&gt; ? Thanks i...

Changing default date printing format in python

Can I change the default __str__() function of the datetime.datetime object? By default, it returns something like '2010-06-28 12:43:56.985790', and i need it to print something like '2010-06-28T12:44:21.241228'(which is the isoformat() function). I need this for JSON serializing of a django model. My model is: class Transport(model...