javascript

How to truncate text until "more" link is clicked?

I have a long series of paragraphs and I'd like to trim each down to 2 lines (50 characters) and when you click a link "more" it will show the full paragraph. I am using the prototype library and rails. I'd ideally like to do this with out breaking the paragraph into 2 divs and showing the other when you click on more. Or is that the o...

Find an achor in a Div with javascript

In javascript I have a reference to a div. In that div is an anchor element with a name='foundItem' How do I get a reference to the anchor with the name foundItem which is in the Div I have the reference of? There are 'many' foundItem anchors in other divs on the page. I need 'this' DIVs one. It's for the web site http://BiblePro.Bibl...

JavaScript: event triggering

How would I go about developing cross-browser event triggering for mouse buttons (left, middle and right) in plain-vanalla JavaScript? ...

Why doesn't my JavaScript XML processing code work in Safari?

I use the following code to open an XML document. It works in Firefox and IE, but fails in Safari. Any idea why? function crearObjetoXML(archivoXML){ //--- IE. if(window.ActiveXObject){ xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async="false"; xmlDoc.load(archivoXML); parsearXML(); //--- FF. }else if(...

Can't change this javascript to read less for height than width on mousemove

Hey, So I'm trying to set up this jQuery CSS dock menu and you can enter in a proximity in the setup. The proximity determines when the zoom will be triggered, but you only get to put in one distance -- same for height and width. How can I change this code to allow to enter in a single one for height and a single one for width -OR- how ...

Does using a framework prevent me from mastering JavaScript?

How would I become a master of JavaScript if I always used frameworks and did nothing by myself? I asked a question on JavaScript and everyone recommend that I use framework (which won't show me the real core of JS!) instead of hand-coding. Did you code your own so-called frameworks when discovering JS for yourself? Did you use frame...

How to get Google to understand links that trigger Javascript?

I'm developing a website that helps people understand rap lyrics. Users see the lyrics of a rap song and can click certain lyrics to see an explanation: (click here for more) As you can see, each explanation has a permalink (in this case http://RapExegesis.com/2636). Here's what happens when you visit one of these permalinks in your b...

How to add Points and Markers Dynamically to Google Maps from JSF

I have an app in J2EE with a couple of projects. Got my .war project that communicates with a EJB business project which has access to some Data. I have an entity which has some information about places, and I want to show a collection of those places in a single map on a JSF page. I have a Collection of coordinates to be assigned as ...

How can I capture the enter key in Firefox 3.5 and redirect the page using Window.Location?

I am trying to implement a search functionality that is capturing the enter key and redirecting to a different page in an ASP.NET 3.5 application. Unfortunately it does not work in Firefox (version 3.5) but in IE it is working perfectly. Please see the following code: Script: function searchKeyPress(e) { if (window.event) { e = windo...

Populate TextBox from Database using JQuery or AJAX

Hi, I have the following scenario: An SQL 2000 database with a table containing the columns UserID and UserName. A webpage with TextBox1 and TextBox2. I need to use JQuery, plain JavaScript or AJAX to accomplish the following: When I type the UserID in TextBox1 and press the Tab key, TextBox2 will populate with the corresponding UserN...

ADSI Query against IIS does not agree with IIS Manager, on Vista

Using Vista... I have a script that uses ADSI to set ScriptMaps on an IIS Website. It's javascript, run within cscript.exe, and the code looks something like this: var web = GetObject("IIS://localhost/W3SVC/1"); var maps = web.ScriptMaps.toArray(); map[maps.length] = ".aaa,c:\\path\\to\\isapi\\extension.dll,1,GET,POST"; web.ScriptM...

How to get values of <input type="checkbox" /> that are checked?

There are multiple <input type="checkbox" value="..." /> in the page. I need to get each of the <input> that is checked to do some operation. I'm using jQuery. ...

Is it possible to include a javascript file which is in a zipped file?

Just like we include a javascript file in html <script language="JavaScript1.2" src="CommonFunctions.js" type="text/javascript"> In this case 'CommonFunctions.js' is placed in current directory. Can we include a javascript file which is inside a zipped file? ...

Open up link in new window maximised

Does anyone know how to open up a new window but in maximised format (spec. in IE7 and IE6)? Javascript methods are OK in this instance too. ...

Ways to improve performance of this javascript code ?

Don't be frightened, its a very basic code. Just wanted to check with you guys if you know any methods to make it faster ? (still learning) It looks so ugly :) Or, if you notice anything which could be made differently... Thanks! function pic_form_function(form, nr, val) { document.getElementById("image_to_delete").value=0; va...

ext.js is undefined

In my aspx page: <script type="text/javascript"> Ext.onReady(function() { Ext.get('mb1').on('click', function(e) { Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?', showResult); }); function showResult() { Ext.example.msg('test'); </script> <div> <asp:Button ID="mb1" runat="server" Text="Button" /> ...

Javascript (or similar) gaming scripts for C# XNA

Lately I am preparing myself to develop yet another game in XNA C#. The last time I worked on a game in XNA C#, I ran into this problem of having to add maps and customizable data into the game. Each time I want to add in new content or change some values to the game character or something, I had to rebuild the whole game or what - whi...

How to remove an element slowly with jQuery?

$target.remove() can remove the element,but now I want the process to be down with some feel animation,how to do it? ...

JS: How to prevent the default action on images in browsers?

In IE, for example, when you press the left button on an image and keeping it pressed try to move the mouse, the drag n' drop action is taking place; how could I prevent this default action so that doing that way nothing will happen. I am building an image cropper, so you should understand why I need that. I am not much interested in kno...

Mootools script not working in Camino/Firefox

Hi there. I currently have script that slides down a once the page has loaded. So far, it works in Safari, Opera and IE8, however it doesn't work in Camino nor Firefox, so I am guessing it's a Mozilla based problem with my code? Here is my full file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtm...