javascript

Using Javascript to Measure the Current Window

Ok, so I'm trying to build a website in which a large picture is the background. I want to be able to load a different size picture based on the user's window size so they (hopefully) don't see any blank space. I want to use JavaScript to measure the size of the current screen. Then, based on the size of the window, I would like to load ...

Javascript parameter not well executed when contain space or specific character

The problem is when the link is clicked. I have a problem ONLY if the third parameter contain space OR/AND character like ê,é,î... <a href="javascript:arretSuivrePortefeuille('13206','Suivre','Arrêter de suivre');">Suivre</a> I receive from FireBug : arretSuivrePortefeuille is not defined javascript:arretSuivrePortefeuil...

Did button actually click?

I have some javascript that ends up programatically clicking on a button: document.getElementById("myButton").click(); This in turn results in the form being submitted using a function call: <form onsubmit="submit_this_form(this);return false;" action="" method="POST"> It seems that a good percentage of the time either the actu...

How do I embed sharethis javascript into another javascript file?

Basically here is the code I have, it adds the share buttons to the existing page. Now what I want to do, is add the sharethis button(which gets called via javascript) next to the twitter image(on the right) Share javascript: <script type="text/javascript"> (function() { function replaceAll(text,strA,strB){while ( text.index...

Datareader's value in javascript array

i want to fetch Image name, and 3 more field's value from database and pass it to the javascript's array....which would b generate from database(Image name and 3 field) http://www.dynamicdrive.com/dynamicindex14/leftrightslide.htm .... var leftrightslide=new Array() var finalslide='' leftrightslide[cnt]='' cnt++ .... ...

Check if object is a jQuery object

Is there a fast way of checking if an object is a jQuery object or a native javascript object? example: var o = {}; var e = $('#element'); function doStuff(o) { if (o.selector) { console.log('object is jQuery'); } } doStuff(o); doStuff(e); obviously, the code above works but it's not safe. You could potentially add ...

jQuery slide/fade functions

I'm trying to modify this snippet: $(document).ready(function(){ $('.showscript').show(); $("div.content:not(.about)").hide(); $(".subnav a, .mainnav a").click(function(){ //remove possible hilights $(".subnav a, .mainnav a").removeClass("active"); var href = $(this).attr("href"); ...

using jQuery AJAX with asp.net webservices always goes to error: instead of success:

Issue I have an aspx page with jQuery code to send an ajax request over to an asmx web service file (on the same website). The response that comes back is not consistent, however, it consistently fires the "error" jQuery callback as opposed to the "success" call back. The status code inconsistently varies between 200, 12030, and 12031. ...

Javascript showing the function text instead of printing value on screen.

function hex(x,y,side,isLast,color) {//Hex object constructor. this.x = x; this.y = y; this.side = side; this.isLast = isLast; this.color = color; function multiply() { return this.x * this.y; } this.multiply = multiply; } var hexagon = new hex(22,22,20,0,1); document.write(hexagon.multiply...

Should I worry about "window is not defined" JSLint strict mode error?

This won't pass JSLint in strict mode: "use strict"; (function (w) { w.alert(w); }(window)); The error--from jslint.com--looks like this: Problem at line 4 character 3: 'window' is not defined. }(window)); Implied global: window 4 Do I need to tell JSLint to ignore the error, or am I seriously doing something wrong? ...

Copying INPUT FILE value to INPUT TEXT with click in jQuery

I would like to copy the value of a input:file to input:text. I can do it with plan JavaScript but I will like to know how to do it with jQuery. ----JavaScript // This what the script would look like with plain JavaScript // It works fine. I just woulld like to know who to do it with jQuery. function fakeScript() { var filepath; file...

How to show Page Loading image/div/text until the page has finished loading/rendering

Hiya, I have a section on our website that loads quite slowly as it's doing some intensive calls. Any idea how i can get a div to say something similar to "loading" to show while the page prepares itself and then vanish when everything is ready? Cheers ...

jquery getscript for iframe object

Hi, I've got a dynamically created iframe that I'm trying to add a script to. For example: var iframe = document.createElement("iframe"); I'd like to inject javascript into this iframe. I've got this working without using jquery by creating a script element under the iframe object and adding callbacks to this script object via the read...

Rich client choice for an intranet web application with 5000+ users

For an intranet web application with 5000+ users we need to develop highly interactive (as few postbacks as possible) client. So performance issue might arise. What would be your choice and why? - ASP.NET Web Forms + JQuery/Ajax - ASP.NET Web Forms + Silverlight - ASP.NET MVC + JQuery/Ajax - ASP.NET MVC + Silverlight - WPF ...

Linking flash to OOP javascript using ExternalInterface?

Hey all, I'm looking to call a flash method from a method in javascript and recieve a result: Example: Flash - ExternalInterface.addCallback("getProgress", getProgress) // Javascript to flash public function getProgress():void { ExternalInterface.call("getProgress", progress); // Send progress back to javascript from flash } J...

jQuery: how to delete list items from lists?

Is there a way with jQuery to remove all the LIs inside a UL with an id of 'myList'? ...

Referencing Other Functions from Name Spaced JavaScript

So I am trying to consolidate a bunch of code into some nice NameSpaced functions, but am having a tough time getting it to all work together. For example, I have this (edited down for clarity): YW.FB = function() { return { init: function(fncSuc, fncFail) { FB.init(APIKey, "/services/fbconnect/xd_receiver.htm...

Experiences with Javeline / Ajax.org javascript framework?

Hi all, I've been looking for javascript frameworks to build a spreadsheet-like app and found Ajax.org. Does anybody have experience with it? With that name is hopeless to try to google for it. I'm curious about how it compares to Sproutcore or Cappuccino. Thanks! jbar ...

How to move an element around DOM tree without affecting related javascript?

In this case I have a containing an iFrame that has an editor, mooEditable. I clone the element with IDs, destroy old one and insert new one where needed. Javascript component doesn't work anymore at this stage. If there is a generic way to do this, it would be terrific if you share it. TIA ...

javascript: redirect to a page?

how do i use jquery [javascript] to goto another page? or change the url in the browser urlfield and hit enter? ...