javascript

input field to put javascript/json and security issues.

I want to let visitors of my web pages to access a textarea where they can write a tiny bit of javascript to configure certain features. Imagine the javascript to be something like this: { max:100; allowFeedback:false; filterEnabled:true ; } I would want to eval what they write and then my javascript would do something dep...

How to get the html so its not encoded?

hi. I am getting the value of a fckeditor with javascript to show in a dialog as preview. Now I want it to show the html tags like I input them but instead it shows me this <p>&lt;div&gt;test&lt;/div&gt;</p> that is <div>test</div> I use this following code function test() { var oEditor = FCKeditorAPI.GetInstance('FCKeditor1...

ajax response byte size

I'm using jQuery's getJSONP and I want to log the duration of the call and the size of the response to be able to have some statistics about the usage of my application. This is a cross domain ajax call, so I need to use JSONP, but as the JSONP call is not done with an XMLHttpRequest object, the complete callback from jquery's ajax does...

ASP.NET AJAX DataContext object not tracking changes on nested complex types

I've been struggling for ages now to get the ASP.NET AJAX DataContext object to track my changes to complex types. The binding seems to work and the underlying object gets updated, but the DataContext object does not track the change. Here is a simplified version of my code (with the WCF fetch and save call taken out). <!DOCTYPE html ...

How to compare if string has a enter key in the end using jquery/javascript?

I have a string value from a user input box. I have to figure out if last char is a enter key (line feed). Thats the code. Here I am checking if last char has a whitespace. Now I also have to check if last char is enter key (carriage return or line feed). How can i do this? var txt = $get("<%= txtUserText.ClientID %>"); if (txt.value.s...

Javascript validation for radio button

Hello.I am doing newsletter subscription.I have 2radio buttons-subscribe and unsubscibe and a submit button.But when I click on submit button,ajax function gets called for subscription.Now i want to do validation.I have written a javascript validation for radio buttons as below: function validate_radio() { ...

Google Maps: marker icons are multi-drawing over same location, why?

I'm using Google Maps and have the map set to height/width=100%. I noticed that when I resize the browser window, my map marker icons appear to redraw on top of the same location. Meaning, if I should only have 1 map marker icon on "987 Main St", when I resize the browser window - multiple map marker icons are being now draw on top of ...

How to grab dynamic content on website and save it?

Hello! For example I need to grab from http://gmail.com/ the number of free storage: Over <span id=quota>2757.272164</span> megabytes (and counting) of free storage. And then store those numbers in a MySql database. The number, as you can see, is dynamically changing. Is there a way i can setup a server side script that will be grabb...

disallow selection inside an input element

I am looking to do the following Disallow text selection inside of an input element Do not show the cursor carrot inside of an input i cannot simply blur the input on click, focus must remain in the input. There is probably a way to do this in just IE, i would of course rather have a cross browser solution but ill settle for IE (or F...

Does this incorporate JavaScript closures?

In trying to learn JavaScript closures, I've confused myself a bit. From what I've gathered over the web, a closure is... Declaring a function within another function, and that inner function has access to its parent function's variables, even after that parent function has returned. Here is a small sample of script from a recent proj...

ADO Execute not reading a line of SQL code?

My code is below: var statement = "test_oracle.sql"; F = aqFile.OpenTextFile(statement, aqFile.faRead, aqFile.ctANSI); F.Cursor = 0; while(! F.IsEndOfFile()){ s = F.ReadLine(); oResult = Project.Variables.oConnection.Execute_(s); The first line that "s" reads is: set serverout on size 10000 An error is returned as "OR...

Ajax Image Gallery Uploader

Hello Everyone, I was just wondering what is the best image uploader with a gallery and ordering abilities. What I had in mind was a back-end page that has thumbnail images to the left, and an image upload panel to the right. When an image gets uploaded, the thumbnails in the left gets updated. I also need a delete function on all of th...

Width depends of height

Can u show me completed html code where it is some rectangle in it with "height=75% of my screen" and "widtht=4/3 of height". So, it should be 3:4 reсtangle where height depends of my screenheight, but width do not depends of my screenwidth. Only of screenheight. i thought i understood previus time, but it was not so. I have this: <s...

Create a SIMILE timeline from dom elements

Hi, I'm currently trying to create SIMILE Timeline from elements of my page, using some dom loading. So far, I'm able to have my elements (as prototype Element objects) in an array, linked with their apparition date as javascript Date objects. What I'm trying to do now is to load a timeline using these objects. The code shows no error,...

Triggering Javascript on cached page?

I'm pretty sure I can't do what I'm actually asking, but am wondering if there is some sort of workaround for the issue. I have a page that has a drop down SELECT form element with several options. If one particular option (in this case, the first item) is selected, we show additional content (via jQuery). This works fine. What happens...

FullCalendar Events: Confused how to enable resizing.

I'm using the FullCalendar plugin, and am very pleased with it, however I can't figure out how to enable resizing. I looked at the source of the calendar on the main FullCalendar page, and my code is no different save that I get my events from a source rather than explicitly define them. What am I missing? $('#schedule').fullCalendar(...

Real Time Twitter Streaming without constant Polling

I was looking at Twitter Streaming API for getting a real-time feed. But I dont want it stored on my server. I just want it pulled from the server and the browser page will retrieve the data from my server's twitter pull URL. But I want to avoid polling my server every few mill-seconds. Is there a way for my server script to keep pushing...

Javascript error when attempting to open a modal window in a modal window

The application is running on a windows server 2003 box using asp.net 2.0 and is an IE specific web app. There is a button that opens a form in an iframe using showModalDialog(...) from a function call located in the javascript. Here is an example of the fucntion: function ShowBusinessHoursSubForm( source ) { var retval = wind...

jQuery - Add click event to Div and go to first link found

Hi guys, I think I've been too much time looking at this function and just got stuck trying to figure out the nice clean way to do it. It's a jQuery function that adds a click event to any div that has a click CSS class. When that div.click is clicked it redirects the user to the first link found in it. function clickabledivs() { ...

Why jquery.animate on a textarea make the blinking cursor disapears?

Hello everyone. I have the following code $(document).ready(function() { $("#myTextArea").focus(function() { $("#myTextArea").animate({ "height": "75px"}, "normal"); return false; }); to expand a textbox when it gets focus. The expand occurs, however the blinking cursor disapears, at least in Firefox! Edited:...