javascript

Exposing an Enum to a WebService's client JavaScript without using it in a WebMethod?

I'm building an ASP.NET 3.5 application and would like to expose an enum I have in my WebService class without using it as a parameter in once of my WebMethods. I have a really simple example to illustrate what I want... Let's say I have the following WebService (I'll call it Agent.asmx): <System.Web.Script.Services.ScriptService()> _...

Getting ipaddress and location of every user visiting your website

How do you get the ipaddress and location of every website vistor of your website through Asp.Net? Thanks ...

Changing media specific CSS properties from Javascript

I have a CSS property (font) that I need to be able to change from Javascript (a pulldown). However, this font should only be used when printing (@media print). So, the javascript can't just change the value of the font, because that will effect the screen view as well. Is there a way to change ONLY the print version of the font proper...

How do I perform a Javascript match with a pattern that depends on a variable?

The current implementation of Remy Sharp's jQuery tag suggestion plugin only checks for matches at the beginning of a tag. For example, typing "Photoshop" will not return a tag named "Adobe Photoshop". By default, the search is case-sensitive. I have slightly modified it to trim excess spaces and ignore case: for (i = 0; i < tagsToSear...

sorting array element using javascript

i need program in which you enter words via the keyboard or file and then they come out sorted by length using javascript ...

Logic behind drag and drop

I am wondering the "how it works" and "how it should be designed and implemented" side of the basic drag & drop functionality. I have never yet implemented such a functionality. I am planning to do so for one of my projects and I do have some ideas on how to implement it. I wanted to make sure I am on the right path and that you people...

Login into Facebook with PHP script, but let me logged in the browser after the end of this script

Please, I am solving this problem.. I need to login into Facebook or Twitter or any other website from my PHP script running on my server. I am normaly doing that with CURL, saving cookies to some predefined file. But now I need something new.. I need to stay logged in with my browser, even when the script ends the login process. Is that...

What should i choose? jquery, mootools, yui, scriptaculous or prototype?

Duplicate: Which Javascript framework (jQuery vs Dojo vs … )? I am totally new to javascript, but i want to implement ajax features into my website. Which JS framework should i learn? Please recommend or which one you are using and why you use it? ...

Why is Firebug making website slow and how to fix it?

Hello, I am trying to debug my web app and i have realised that firebug is making it damn slow. Is there any reason for this? Are there any set of reasons like maybe long js file which cause this problem? Thank you very much. UPDATE Am developing a web-app which will be primarily used by developers. Now if I dont find out what exactly...

Wiring up javascript events and passing parameters

A bit background: I've got a page with a table and a number of checkboxes. The page is generated in asp.net. Each row has a checkbox, there's a checkbox in the header, and in certain cells there will be groups of check boxes (you get the picure lots of checkboxes). Each of these check boxes currently works fine with a little bit of jav...

Javascript Standard Documentation Tool

Is there a standard/tool for documenting JavasSript? I'm thinking of something similar to Javadoc. ...

Ruby - memory game

Hey, I am trying to build a very simple game using Ruby that will be on the web. I am am trying to: user goes to page and a string appears for X amount of seconds and then after X amount hide it and ask for the user input then check to see how far the person got (how many they guessed right) I would have strings for: timeout in secon...

Python html output (first attempt), several questions (code included)

While I have been playing with python for a few months now (just a hobbyist), I know very little about web programming (a little html, zero javascript, etc). That said, I have a current project that is making me look at web programming for the first time. This led me to ask: http://stackoverflow.com/questions/731470/whats-easiest-way-...

Drag'n drop between two unrelated web applications

Assume you have two web applications running in two different tabs/windows in your browser. Is there a predefined interface in IE, Firefox or Google Chrome to pass data between the two windows? If so it should be possible to implement drag'n drop, right? Because I don't think this is possible I wonder if the same could be achieved with F...

Javascript Regex Only Textbox

I was able to find the solution for this in c# / .net but not for regular web html. If there's already an answer let me know and i'll close question. How to create a text box that only will allow certain characters (ex. alphanumeric) based on a given regex (ex. [a-zA-Z0-9])? So if a user tries to enter anything else, paste included, it ...

JavaScript: radiobutton names get a 0 at the end

Hi I have a HTML form where which: clone a field set rename all radio button names in the set (they need to be unique so they are treated as a separate group after cloning). When I inspect the DOM after the cloning, all the radiobuttons has a 0 at the end of the name string. This happens in both Fx and IE, does anyone knows why? I...

how can Javascript access location/selected text across frames when domain differs?

I have a page with a frameset, where I would like Javascript in one frame to access the selected text and location of the document in the other frame. I can do this using the getSelection() function and document.location parameter, but ONLY if the other frame is served by my local server. The javascript code returns null strings if the o...

Get image width and height

I need to get an image's dimensions in javascript (jQuery) when no styles are specified for it (jQuery's css() returns 0). Maybe it is because I'm loading the image with jQuery just before asking for its dimensions. If this is the case, is there any event to listen that tells when the image has been loaded? ...

How to increase the page height by X pixels by using only javascript

Assume an HTML page: <html> <body> .. html content (outside of our control) .. .. javascript block .. .. some more html content (outside of our control) .. </body> </html> Assume further that the only part of the HTML page that we're able to control is a javascript block in the middle of the page. Using that javasc...

Is this a good JavaScript object model? (phone book project)

I need to create a phoneBook. Thanks to a form, I can retrieve a person's data. I need to use objects for that purpose. I created a phoneBook() object with the help of a method that enables to add a person in the phoneBook. I decided (it wasn't asked for though) to divide the "person" concept in 2, which results in a "Person" object and...