javascript

Alternative to "this" variable.

I am trying to write a simple script in JavaScript, just for testing purposes. I am defining 2 variables, sort of unnecessary, but nice anyway which hold string values for two different scenarios, if the element before the button contains bold text when the button is clicked, the respective variable will be displayed in an alert dialog ...

detecting where my site is iframed

I know that iframed pages can tell that they are, but is it possible to tell where? parent.location runs into security issues when parent is a different domain, as far as I can tell. Any work arounds? ...

Strip "http://" from pasted text into textbox

Hi! I'm a total newbie when it comes to Javascript/jQuery so hopefully you can help me. I have a textbox where most people are gonna paste links into. Is there a nice way for the textbox to detect that a link has been pasted (starts with http://) and then remove the protocol dynamically in the textbox without having to push a button or...

Can you make the font-size attribute scaleable based on the browser window?

Here's one I've never encountered before. Is it possible to make a font scale with the window size of the browser. For example: making the font size 100% of the available width. I'm open to Javascript, jQuery or CSS solutions. ...

Javascript 'this' keyword returning href attribute rather than Object on anchor tag

Requirement: Return the element object. Problem: Using the code below, I expected the links to return [object], but they actually return the string in the href attribute (or in the case of the first link, the Window object). (The HTML below has been tested in FireFox 3.6.8 and Internet Explorer 7 (7.0.6002.18005) with the same results.)...

Using HTML to open a program with variables

Greetings, all! I have hit a bit of a brick wall and was hoping that I could get some help. I'm trying to write a site that people can access with IE6+ that will allow them to click a link that will open a piece of software on their desktop (the run/save dialog is OK) that also contains variables. Thoughts, ideas? It should look some...

Timed session variables in PHP? I am trying to lock people out for failed logins.

I am having trouble searching for what I am looking for. I figure it is best I ask here, so I can also find out what is the best practice or method for what I am attempting. I want to make a lockout script that prevents people from trying to login in too many times to prevent password cracking. I have one that makes a fade-in pop-up, wh...

javascript draw rectangle on google mashups

Hi, I wanted to draw a rectangle as follows: http://www.codingforums.com/archive/index.php/t-86247.html but only once every time. For example, if I draw rectangle second time I am drawing a new one the previous immediately should disappear. on google mashups http://code.google.com/apis/maps/documentation/javascript/v2/examples/map-s...

Understanding the document-ready event

Hey, I was just writing another basic script for my JS & jQuery practice, and I was just pumping out the goold ol' document-ready event when I realized what this was actually comprise of, and I wanted to know if I was right or not: Here is the document ready for jQuery: $(document).ready(function(){}); Now, the dollar sign is shortha...

javascript consolidating switch statement

I have the following: switch(state) { case MyStates.StateA: //do something break; case MyStates.StateB: //do something break; case MyStates.StateC: //do something break; } Say StateB and StateC both need to process the same bit of code, how can I avoid the duplication? Note that I cannot set MySta...

why do my images change position when rolled over?

HI, I have a row of buttons (6 six) al same size. When each one is rolled over.. <img src="home.jpg" onmouseover="HomeAct(this)" onmouseout="Home(this)"/> function HomeAct(obj){ obj.src='webseparada/home.png'; } function Home(obj){ obj.src='webseparada/home.jpg'; } home.jpg is a regular rectangle home.png is a folder where...

JMeter create response variable

How can I create variable from a response data. I want to create variable n1 which will get the value from variable v1, because v1 is diynamic variable.Response part: q=q.replace("v1=2780"); ...

Why is returning true after calling $.post() not working?

I have a function which returns another function which returns a boolean value, on this i do validation which is causing unusual behavior. The code in the function is as follows: $.post( "classes/InsertCustomer.php", { iResult: theResult.valid }, function(data) { alert(data); }); return true; When this runs, the post ...

[JQUERY - JSONP] webkit based browser interpretate the json as a script

hi guys! im just tryin to get my zootool items via js to push them in my blog's footer...but with no success. here's the code im using (jquery framework) jQuery(document).ready(function($) { //first try var url = "http://zootool.com/api/users/items/?username=USER_NAME&amp;apikey=API_KEY&amp;jsonpcallback=?" $.getJSON(url, function(data...

getting elementById within a DIV

Is there a way to get ElementById within a DIV. Problem is on a Webpage I have 25 DIV and each of them contains a hidden DIV with same IDs. ...

How do I clear all options in a dropdown box?

I'm stumped. My code works in IE but breaks in Safari, Firefox, and Opera. (big surprise) document.getElementById("DropList").options.length=0; After searching, I've learned that it's the "length=0" that it doesn't like. I've tried "...options=null" and "var clear=0; ...length=clear" with the same result. I am doing this to multiple ...

Googlemap custom infowindow.

Is there a way to create custom infowindow in new API V3 of googlemaps. If yes is there any example available? Thanks in advance. ...

Allow Paging for HTML list

Hi guys, I am building a SharePoint web part that creates a HTML list as below <ul> <li> ... </li> </ul> Is there a way to enable paging on this list using Javascript because the list is too long? Thanks. ...

Googlemap Marker with Dynamic text

I have a Marker Image And at different Location I want to write Dynamic text on Marker Image. Is it possible in V3 ...

call javascript function from jquery

Hi, I inherited some javascript code. One of them is a function chg(x) which reloads the page after a drop down list's value has been changed. How do I use jquery to change the drop down list's value and call chg(x) when the value is changed ? ...