javascript

Python over JavaScript? (Facts, please)

Hi! I recently learned JavaScript an all of the sudden I hear about Python... Should I go learn Python or just stick with my basic JavaScript knowledge? If you have some "facts" I would love to hear them! Like efficiency, difficultylevel and so on, an so on... Thanks :) ...

Google chart formatting

I have the following script which I need to modify a little. Here is the json: [ {"User1":{"v": 50.00,"f": "£100"}}, {"User2":{"v": 10.00,"f": "£20"}}, {"User3":{"v": 10.00,"f": "£20"}}, {"User4":{"v": 10.00,"f": "£20"}}, {"User5":{"v": 20.00,"f": "£40"}} ] and here is the script: <html> <head> <script language="...

How do I remove the square brackets at the end of a JS variable name during AJAX calls?

I currently have the following javascript array: var stuffs = ['a', 'b']; I pass the above to the server code using jQuery's load: var data = { 'stuffs': stuffs }; $(".output").load("/my-server-code/", data, function() { }); On the server side, if I print the content of request.POST(I'm currently using Django), I get: 'stuffs...

jQuery tablesorter - sorting by rows and columns, not just columns

Hi, I have this problem. I have a big table with categories in THEAD and in TBODY I have authors of articles. When i apply tablesorter on this table, I can sort it by columns But I want to sort it by rows too, so I can tell, how many articles author has in which category. Is it possible? Oh I forgot, I am using this tablesorter: http:/...

jquery carousel jumping bug

Hi, I've built a horizontal accordion with jquery. I'm having a problem with it. When it animates from one panel to another there's a jump at the right hand edge of the carousel. I've tried everything to get rid of this...adding widths...changing the js..removing whitespace from html etc..any suggestions? http://boudaki.com/testing/car...

calling a javascript function when user clicks 'X' to close a form

I already have a 'Close' button that calls some javascript function. However, if the user just clicks the 'X' to close, the function is never called. Any way to call a function when 'X' is clicked, or hide the 'X'? Thanks. ...

Google maps V3 GSize has changed

I am switching google maps from v2 to v3 and I am running into a problem with finding the conversion from GSize. Does anyone know how to make the change. opts = { 'labelText': infoname, 'labelClass': 'citymarkers', 'labelOffset': new GSize(-35, -40) }; var marker = new LabeledMarker( new google.maps.LatLng(this.lat, th...

jQuery::when I use fadeIn() my page moves its focus!

Hello. I have a simple HTML page, and some javascript using the basic $(#element).fadeOut method from jQuery on mouseover event. I also use the $(#element).hide() method. But my page focus shifts up! Meaning: if I scroll down a bit, and mouseover the element (which toggles the script), script is executed well, but my scroller goes up i...

Opening a YouTube video in a lightbox or something on page load

My client wants a YouTube video (embeded object) to popup when a user comes to their site. Does anyone know how it do this and what to use. It should be a lightbox or shadowbox, something that's not a popup. The video should run automatically and ideally close when it's over. Maybe I can specify a time until auto-close or something? ...

sys.webforms.page request manager server error exception

am using asp.net with Ajax timer update panel and script-manager in page load i get data and work around it every timer tick am using jquery to show my data in JavaScript chart control in IE work good put in Firefox 3.6.7 no data show to me and get me error in error console say: sys.webforms.page request manager server error exception:...

Javascript 'object expected' when working with Google Visualization API

Hey everyone, so I am working on creating a small class to help me work with the Google visualization API. You can see how it works here... http://code.google.com/apis/visualization/documentation/gallery/annotatedtimeline.html Here is google's implementation. google.load('visualization', '1', {'packages':['annotatedtimeline']}); ...

Possible to manipulate javascript generated elements?

I have a page dynamically generated with javascript and it contains several input fields and a button. When I click the button, nothing happens...Is it because it is a javascript object and not a "real" dom object? If so, is there a way to interact with the object? I just wrote a simple alert to see if the button is even working. jQu...

Updating cookie in client and aware server-side (ASP 3.0)

Here's the scenario : I need to isolate session variables of my application when tabbed browsing on IE8. I'd like to set an ID by tab using SessionStorage. How to access this ID from my ASP script code (server-side) ? Right now I'm using a cookie and reloading the page, but on cookie change and reload my server-code is executing twice.....

ajax response does not write to html page what to do?

languages used: html, javascript/jquery, and php 5.2 So I created this function that onclick creates a "group". For simplicity, we'll say this is a group (aka the response from ajax.): <div id="group1">Group #1</div> This is where the groups go: (html page) <div id="groups"> <!-- groups go here --> </div> So the user creates g...

Better option for strongly-typed containers in javascript

I've just discovered the way to create fake 'classes' in javascript, but I wonder how you can store them and still get easy access to their functions in an IDE. Like this: function Map(){ this.width = 0; this.height = 0; this.layers = new Layers(); } Now I've got a function that loops through an XML and creates multiple Map(...

For a4j:jsFunction, does reRender or oncomplete happen first?

Hello, I have a jsFunction that I am running, and would like javascript to be performed after re-rendering is finished. I'm guessing that the javascript in "oncomplete" is called -after- re-rendering takes place, but don't know for sure. Any thoughts? Thanks. ...

Javascript throws an "is undefined" error.

I've been working with Javascript and recently I've been stucked with an error which I can't solve. The Firefox console throws an "info[last] is undefined" error, and I've got no idea what is causing that. Here is the code, the line which provokes the trouble is number 7: $("textarea").each(function() { var id = $(this).parents("div.ar...

Microsoft JScript runtime error: Object expected OnClientClick

I was just doing a quick test of something, and before I could really get started I got this error. I have no C# code yet and this is my aspx code: <script language=javascript type="text/javascript"> function myOnClick() { //if (TextBox1.Text != null) //DropDownList1.Visible = true; retur...

Safari not submitting on 2nd click

I have an image that when you click it its suppose to call another function and open a window. It works the first time you click it but when you close the window and click on it again nothing happens. I've checked the script debugger it does infact get into the method the 2nd time but nothing happens even when i step through. Markup: ...

How to append a line of JavaScript (rather than an exteral .js file)?

I want to append a script tag which executes one line of JavaScript to the head of a document, rather than appending a script tag which is empty and uses the src attribute. Here's what I've got so far: <script type="text/javascript"> var scriptContents = 'alert("hi")'; var theScript = document.createElement('script'); theScript.type ...