javascript

Can Javascript access files on the server?

Some one asked about How to connect to SQL server database from javascript? and i found thats its possible, So some one can surprise me and say yes on my question? Can Javascript access files on the server? I know its not possible, but i said NO on the sql database question, but i found someone answering yes !! ...

Validation Before Postback Event on Masterpage Asp.net

Hi all, I was wondering if anyone knew of a way to do some client side validation with jquery and then run the postback event manually for a asp.net control? Here's a sample Master page i.e. <script type="text/javascript"> $(document).ready(function() { $("#<%=lnkbtnSave.ClientID %>").click(function() { alert("hello"); ...

How does the javascript preloading work?

I don't want to know a way to preload images, I found much on the net, but I want to know how it works. How is javascript able to preload images? I mean, I tried a snippet from here, and even if it works, it doesn't seem to preload images. When I check firebug, I can see that the image is loaded twice, once while the preloading, another...

getting or setting cookies with javascript

Hello, My question is if I can set a cookie using javascript (and read it) My first impression is that the code beneath doesn't work If I look in my vista cookie folder, I can not the name off the cookie function zetCookie(naam,waarde,dagen) { if (dagen) { var date = new Date(); date.setTime(date.getTime()+(day...

Why does this bookmarklet JS code not work when put in an onclick handler?

I have a pretty typical bookmarklet code that's working perfectly for me in all browsers. However, when I take this code and put it in an HTML's element onClick handler, it doesn't work in IE (6, 7, or 8). This is the code: javascript: ( function(){ function l(i,u){ var d=document; var s; try{ s=d.standardCreateElement(...

Are there any limitations to what can be done in an inline onclick handler?

When adding code to an onclick handler, are there any limitations to what can be done? Can I have unlimited statements separated by ; ? Can I declare variables that will live in the global scope? Can I declare an anonymous function right in there and call it? (function(){})();? Is there any limitation? The reason I'm asking is that i'm...

I'm having a problem selecting an element in jQuery

Hi, I'm using selectorgadget to help me select elements on the document. But when I used it on jQuery it doesn't work. The nth-child selector seems not to work for me. <div id = "wrap"> <div class = "book"> <div class = "chapter"> <p class = "text"> <table> <tbody> <tr> <td>Title</td> <td>...

calling a javascript function from a form result.

Hello, So I have a html page(actually generated with php), that will make a popup window containing a form. All my javascript stuff is in a seperate javascript file. I want to know if it is possible to call a function from my javascript file from the form resulttext. Here is the first html page <script type="text/javascript" src="x.js...

collapsing a form with javascript

Is it possible with javascript, and without using a framework such a jquery, to have a simple form with a a list of checkboxes or radio buttons, and if a particular one is selected, expand to show further further checkboxes/radio buttons? ...

How to remove a tag, and preserved the text in the element using RegExp?

Hi, I want to remove the element tag and want to preserve the text inside the tag. I use the replace function of RegExp but it removed everything: The tag and the text inside the tag. I dont want that, I want to remove the tag only. Clean up the text, remove the tags, I want to present the text only. var str = str.replace(/<.>[^.]*\/.>...

Things a programmer should know before building a website

Duplicate: What should a developer know before building a public web site? I have been asked to make a website for a county fair. I used to make websites (they all sucked). I want to make this one using HTML, JQuery, and any other tools you guys recommend. I'm still a beginner when it comes to websites though, for example I didn'...

jQuery Star Rating Plugin is not recognizing {split:4}

I'm using the jQuery Star Rating plugin on an ASP.NET MVC site, and I can't get it to work with split stars. As best I can tell, I'm creating the proper radio buttons. I've tried using both the RadioButton helper method and pure HTML, and I've also tried with and without disabled inputs (on this particular page, I intend to use disabled)...

How to change class variable in Javascript?

PROBLEM SOLVED. Special thanks to Andrew Noyes for explaining its not a class but a Object Literal Notation. What a noob am I.. EDIT: SORRY, i made a mistake in my js file, the structure of my js is like this: (I am totally new to javascript, i need your guys help here...) var className = { settings : { setA : true, setB: ...

RegExp: I want to remove unnecessary words in the Sentence. How can I do it?

I have a sentence, and I want to remove some words from it. So if I have: "jQuery is a Unique language" and an array that is named garbageStrings: var garbageStrings = ['of', 'the', "in", "on", "at", "to", "a", "is"]; I want to remove the "is" and "a" in the sentence. But if I use this: /This statement is inside a for loop. I'm l...

FCKeditor disable using javascript not working

<script type="text/javascript"> window.onload = function() { var oFCKeditor = new FCKeditor( 'content' ) ; oFCKeditor.BasePath = "js/Javascript/fckeditor/" ; oFCKeditor.Height = 300; oFCKeditor.Width = 600; oFCKeditor.ReplaceTextarea() ; } function fnenable(){ var myValue=document.getElementById("checkbox1").check...

Ajax: Building HTML vs injecting HTML

Trying to comply with StackOverflow's suggestion of asking a question, not creating a discussion, let us consider these two methods that use the HTTPAsyncRquest to update a web page without refreshing it: 1) Data returned by AsyncRequest is parsed/interpreted in order to build the resulting HTML that updates the page e.g. JSON::parseAn...

Capture all links including form submission

Hello, I am wondering how to capture all links on a page using jQuery. The idea being similar to Facebook. In Facebook, if you click on a link it captures the link and loads the same link using ajax. Only when you open a link in new tab etc. will it load the page using regular call. Any clue on how to achieve such kind of functionality...

Is GWT compiled JavaScript obfuscated or only minified?

So, as the title says, when GWT compiles Java into JavaScript, is the result just minified, or is it obfuscated also? ...

get content to tooltip from url in javascript

I'm using cluetip for tooltips in my web site, and I want to set the tooltip text based on the link url. For example: I have a link on my page to "http:abc.com/display?content=sweeties" and I want the tooltip to read "sweeties" Someone show me how, please? ...

How to send a hashtable to an asmx webservice?

I'm trying to send a hashtable to my webservice using JSON. However, you can't send a dictionary-type object (for some reason). A solution that apparently works is "List(Of KeyValuePair(Of String, String))", as output anyway: <WebMethod()> _ Public Function test() As List(Of KeyValuePair(Of String, String)) Dim ret As New List(Of K...