javascript

Order of CSS and Script Calls in a aspx page

Is there any specific order in which the external CSS or Scripts should be called in a aspx page which could help a bit in decreasing the page load time? i.e script type="text/javascript" src="../Includes/JavaScript/jquery.ui.tabs.js" link href="../Includes/css/ui.all.css" rel="Stylesheet" type="text/css" or link href="../Includes...

Javascript: Formula to get Direction from X, Y Coordinates

Hey, this just derived from Microsoft, suprise, suprise. I was just making a little util to quickly do drop shadows with CSS, and realized that it can only be duplicated in IE with filters. The Shadow filter however uses direction instead of x, y coordinates. filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135,...

how to replace url of webpage with ip adress

i am trying to basically replace a webpage's url with its ip address for example, instead of www.facebook.com i want to replace it with 66.220.153.11 Rationale i have recently discovered that our school blocks websites based on a particular string patern in the url for example www.facebook.com is blocked but 66.220.153.11 is not ...

Multiple submit Button click problem?

I have a form which inserts data in DB on Submit button click but the problem is when client click the button multiple times its sends multiple create requests means multiple button click events for the same time of same data, which must not be. I tried to disable the button when client click the Submit button first time but after this ...

Javascript test function strange behavior

Hello All, I found out the javascript test function has a strange behaviour in my code. I defined a match string variable in the first line of my widget. var emailPatt=/@(tomtom|stream).com/ig; And then i use it in my function var me=this; alert(emailPatt.test(eo.data.username)); if(emailPatt.test(eo.data.userna...

Custom google map infoWindow

Hi I was working on customization of gmap infoWindow. I wrote the following code.. <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAWFxfdA2Gu9LJMJw80x2tKhQhoncwM0SGfm1Opx_70t50wOiSWxRz3mt77PVPCsnMPENBxlx9FaX5AQ"&gt;&lt;/script&gt; <script src="javascript/extinfowindow.js" type="text/javascript"></script> <...

CKEditor Default File Path

Using CKEditor (combined with KCFinder for file upload), when I use the browse button and retrieve my file I get the path: "/demo/cms/uploads/images/image.jpg" Which is the path to the image, however if I then move the file around within the editor, the automatically path changes to: "uploads/images/image.jpg" Which won't work from...

how to check the Variable is or not in the Memory using javascript .

i want to check the marker(google maps v3) is or not in the Memory when i zoom in map and can't see them . so what can i do , ...

Get escaped html from td and put it into input as value

Hello, I have html <table> <tr><td id="cell">&lt;a href=&quot;&quot;&gt;Google.com&lt;/a&gt;</td></tr> </table> <div id="to"></div> And I have javascript $(document).ready(function() { var html = '<input type="text" value="'+$("#cell").html()+'" />' $("#to").append(html); }); I don't know why, but when executing this code I...

How do I call a defined variable with jQuery?

Hi all, I'm kinda stuck. I defined three variables:var part1 = "<form><input type='button' value='Open Window' onclick='window.open('http://jsfiddle.net/ "; var part2="5Xket," var part3 = "'toolbar=no',menubar='no')></form>"; My aim is to concat those variables to create a working link when clicking on the button. This is my try to c...

How to close jQuery Tools Overlay on click, no matter where?

I've added the Overlay effect of jQuery Tools to my site, using the "Minimum Setup". Unfortunately when the user wants to close it, he must target this tiny circle on the upper right. Usability suffers this way. It would be far better if the user could simply click anywhere to close it. Can I modify or add some code so it would close th...

jquery selector needed to select next table from element

hi, I need a selector that basically starts at the element that I have clicked and finds the next item with a certain class on the page. See my example below: <table> <tr> <td>Blah blah blah</td> <td><p class="click">Fire jquery</p></td> </tr> </table> <table class="hidden"> <tr> <td>blah blah blah</td> <td>blah blah blah</td> </tr> </...

Javascript Confirmation Box on Exit

Hi there, I got strange problem with setting up a confirmation box on user exit. Here's the code: function closeIt() { var message = "Click 'Cancel' right now!"; evt=(typeof evt == 'undefined') ? window.event:evt; evt ? evt.returnValue = message:null; return message; } window.onbeforeunload = closeIt; ...

Escaping in eval's argument

Hello, I'm using eval to assign dynamic object's properties. property_name_1 = property1; property_name_2 = property2; property_value_1 = 1; property_value_2 = 2; var obj = new Object; eval("obj."+property_name_1+"='"+property_value_1+"'"); eval("obj."+property_name_2+"='"+property_value_2+"'"); then I'm using this object as post da...

Passing variable value form js function to rails view (dynamic select)

Hi, I'm using Ryan's solution to add and remove nested model fields dynamically through JavaScript using jQuery. There are 4 models: client, c_person; project, p_person. And one-to-many associations: client has many c_people and project has many p_people (these are people from client side but they belongs to project). Hope it isn't to...

Extending jquery Attribute selectors

Hello, i have an inline popup that shows a list of checkboxes and associated labels each in seperate span element. i want to add a text box where user can type to filter the values (user names) in the popup. i have following code $("#toEmpFilter").live("change", function () { var FilterVal = $(this).val(); $("i...

How bad is it to add custom attributes to HTML tags?

Possible Duplicate: Custom attributes - Yay or nay? Hello, it might be a very basic question but I wonder if are there any implications to set custom attributes to HTML tags... in terms browsers compatibility, SEO, complainants etc. thanks ...

Refresh page when url hash is present

I have a navigation system on my site that uses javascript to slide horizontally stacked divs left and right into view. I'm trying to make the site function better with javascript turned off, so I have a second navigation system that uses hash values to 'go to' the appropriate section. The problem arises if someone is on say http://mys...

Parsing HTML / Javascript into a MySQL database

I'm looking for suggestions as to the best way to parse the following calendar... http://www.ucd.ie/events/calendar . I can't detect any well known framework being used nor can I find it in RSS/XML/JSON format. The only possible way to parse the following that I see is to parse the raw HTML which is far from ideal especially since many...

IE Javascript error "Object doesn't support this property or method" within jQuery

Hi everyone, For some reason, I am getting the following Javascript error in Internet Explorer 8 on line 3156 of jquery.js (version 1.4.3, non-compressed version): Object doesn't support this property or method. No error occurs in Firefox and Google Chrome. This is the line the error occurs on: if ( (match = Expr.leftMatch[ type ].exe...