javascript

Upload image from Silverlight to ASP .net MVC 2.0 Action

Hello ... I have been trying really hard to Upload a photo from a Silverlight app to ASP .net MVC app. I simply use WebClient like this in Silverlight : private bool UploadFile(string fileName, Stream data) { try { UriBuilder ub = new UriBuilder("http://localhost:59933/Admin/Upload"); ub.Que...

What book/resources for large Javascript application development?

I'm looking for a decent book or online resource to help me learn about developing large Javascript applications. There are lots of books that go over the fundamental and advanced features of JS, but I'm looking for something which covers application structure, coding practices etc. Any ideas? ...

Use AJAX to reload captcha

Hello! This question may have been asked already - but unfortunately, I could not find any satisfactory answers. I will just ask it for my concrete case and ask the admins not to delete the question for at least a few days so I can try it out... I have a page. It uses a captcha. Like so: <?php session_start(); // the captcha saves the...

How to validate username using Javascript?

Hi, I want to know how can I validate using Javascript that if user has entered any username at the time of creating an account is already present in database and ask user to type any other username? ...

Looking for Google Reader javscript commands for controlling events

I've played in the /reader/ui/ code for a few hours now, and couldn't figure this out. Also, I didn't see any exact help when searching StackOverflow. This is really a JavaScript un-obfuscator question. I'm looking for a way to call the obfuscated Google Reader javascript commands... and am having trouble determining what actual funct...

MSDN "pseudoframe"

So, I'm trying to replicate MSDN "pseudoframes" here. Their pages are laid out like they're using an old-school frameset, but inspecting their elements with firebug reveals they've done this with purely div's. Here's my attempt at it. Its not perfect though, it only works in Chrome and Firefox, it has this weird highlight select behav...

How can I pass a javaScript function to a Java Method to act as a callback (Rhino)

Hi everyone, Basically I'm trying to pass a javaScript function to a Java method to act as a callback to the script. I can do it - sort of - but the object I receive is a sun.org.mozilla.javascript.internal.InterpretedFunction and I don't see a way to invoke it. Any ideas? Here's what I have so far: var someNumber = 0; function st...

Using JQuery to insert new cells in a table row?

I know that JQuery is a very powerful library and was just wondering if it had the following capability that I really need. Lets say I need to insert new cells into a table row, I know how to do this basic task, but I need to insert my cells in a highly unusual way due to some of the requirements that are needed for the new cells. I ne...

Pre-cache site as user visits

I am making a static site which is 'forced' to be cached via Cache-control, etc. When a user visits my site, I want the browser to crawl my site, caching pages, so when the user navigates to a page, the load is almost instant. (I do not need a recursive crawl, as that will probably happen as the user navigates between pages. I just ne...

Javascript setFullYear

var currentDate=new Date(); currentDate.setFullYear(2011); alert(currentDate); This works, it sets the year to 2011 as expected. alert((new Date()).setFullYear(2011)); This one doesn't work. Any idea why? Am I misunderstanding the syntax? ...

Using JQuery to get text of a div that's a child of a header to replace a different header

Hello all, I'm trying to get the text contents of a .div('.child#') child of my event.target('h6.class'), and replace my other headers('h1.replacHeader#') using this script below... $('h6.HeaderToBeClicked').click(function(event) { var $target = $(this); $('.replaceHeader1').replaceWith("<h1 class='replaceHeader1'>" + $target.c...

How to access child div elements under a given condition with javascript?

My main question is to calculate the last alert message, but any other information is also welcome. I am trying to learn javascript (to use with greasemonkey later), but I am struggling a bit to grasp the DOM and how to process it. <html> <head> <script type="text/javascript"> function my_test() { var elements = document.getElement...

IE browser script to determine which (if any) ActiveX control will handle specific mime type

I'm trying to figure out in an IE script (javascript or vbscript) which ActiveX control will handle a specific mime type, "image/tiff" in this case. This is easy to do in other browsers that use plugins with; navigator.mimeTypes["image/tiff"].enabledPlugin.name which would return something like QuickTime Plug-in X.X.X I've fo...

JQuery Syntax Problem?

I am using JQuery to insert divs into a page but i cant seem to get the quotation marks correctly setup. For example the code below works fine: var newDiv_1 = '<div id="event_1"><b>Hello World 01</b></div>'; $('#mon_Events').append(newDiv_1); But when i try to use variable in place of the normal text, i doesnt seem to work: var ev...

Using JQuery Ajax to call a php function

Hello! First and foremost thank you for checking out my problem, and for any help you may give! Okay, so like the title says I'm in need of calling a php function from my index page, which adds a new record in my database as a vote, using JQuery Ajax. This function will return one integer, which will then be printed inside the form but...

In jQuery datepicker beforeShowDay if fails

HI. I'm having problem to highlight more days. Somehow the if statement in beforeShowDay isn't true when it should be :( dateString typeof is string and an example is available in the screenshot at http://mikaelz.host.sk/datepicker.png Pasted code: var dates = new Array(); function addDate(date) {if (jQuery.inArray(date, dates) < 0)...

Retrieving image from database using Ajax

I'm trying to read image from database with Ajax, but I could not read the xmlhttp.responseText to the img src. The image is saved as binary data in database and also retrieved as binary data. I'm using Ajax in JSP, because I want to give the user the ability to upload images and I will view the last uploaded image, on mouse over action ...

Find the sum of consecutive whole numbers w/o using loop in JavaScript

I'm looking for a method to do calculations like: function sumIntegerUpTo(number) { return 1+2+3+...+number; } If you pass number as 5 function should return the sum of 1+2+3+4+5. I'm wondering if it's possible to do without loops. ...

how to make javascript rearrangeable windows?

hi guys, I want to make a web page with several type of forms,each one on a different area that allows those areas to be rearranged and user will be able to change their position according to their preference.(X form to the left top, Y form to the right bottom etc.) i don't know what that type of windows are called, but think you can ge...

Iterate through directory filenames using JavaScript on ASP.NET C#

Hello all, I'm trying to read all filenames from a specified (server- not client) folder, and insert all the filenames into a javascript Array. It should behave like the Directory.GetFiles method in ASP.NET C#. I created a new array, and I just need the loop method (Javascript or jQuery) to iterate in the specific folder, and insert all ...