I am definitely more designer than programmer. Not sure if this possible, If it is then I am definitely getting the syntax wrong. I'm trying to pull array data as such:
var carouselC2R1Array = new Array(500, 4, 0);
var currentSilo = 2;
var currentImg = 1;
carouselWidth = "carouselC"+currentSilo+"R"+currentImg+"Array"[0];
carouselMaxImages = "carouselC"+currentSilo+"R"+currentImg+"Array"[1];
carouselCurrentImg = "carouselC"+currentSilo+"R"+currentImg+"Array"[2];
But instead of returning the correct data I get this:
carouselWidth = c
carouselMaxImages = a
carouselCurrentImg = r
I wrote a simple code in javascript and it is working fine with IE and Firefox but the out put in php array count is correct in IE but not correct in Firefox
<script language="javascript"> var arrdimensions = { "codimesion":{"s":{'0':'dimesion1','1':'dimesion2','2':'dimesion3','3':'dimesion4','4':'dimesion5','5':'dimesion6','6':'dimesion7'},"c":1,"m":"50", "sc":1, "f":"nopcs[]"} }; function adddimensions(what) { [Code]...
I am doing a few tests with javascript and oop. but one failed so i falled back to the way i usually do this but it still isnt working properly. i am using $.post() but instead of returning whatever is echoed in the php file like it does with all my other scripts it returns the content of the file:
Isnt returned in var data but the whole file is returned as a string.
The url is a very straightforward servlet that queries a database and returns either Y or N. That part is working fine. The first alert shows Y or N just as it is supposed to.
However, the second alert is always showing Turbo, as though the if statement is not able to compare properly. This is probably javascript rather than specific to jQuery, but can anyone see where I'm going wrong?
I am using a js calendar script that populates a text field with a date. When clicking in the field the calendar shows then i choose a date, calendar closes, the date is now in the field. great it works fine.
I want to make this call from a button. when adding the code to a href, the popup shows but nothing happens when selecting a date. I have tried the following scripts will failure.
*html a href and img tag left out* onclick="if(self.gfPop)gfPop.fPopCalendar(document.this_form.elements['example[]']);return false;"
So I'm loading the div#my_events by prepend(data) where "data" is another well styled div. Is there anyway to animate this returned data. Unfortunately I can't just specify a unique ID on the incoming data. So I was wondering how else I might be able to address this data I'm returning.
It is basically a topic list, with a modal that sends jquery to add a topic to the database, and returns the topic from the database, hides the modal, and displays the last added topic at the top of the topic list. Now I'd like it to do something slightly fancy like animate the color of the background to bring the user's attention to it.
Here is what I'm trying to do. I will pass a directory to a PHP script, that script will then return an array of filenames back to the javascript that called it. In the javascript I want to take the filenames returned and create links to them in an unordered list.
The PHP code to get the filenames is done and when I run the script I get an array that I have formatted into json... an example of the encoded array is as follows...
So here is the jquery I'm trying to use to get the filenames and create my links... But I must be missing something because my variable... data ... is empty... but status is Success.
In this dumb example, I'm unable to match the 'data' returned variable with the value I assigned to it in php (I can't manage to enter my 'do stuff'), yet its value is 'ok' if I display it. I have no problem to retrieve html code from php and inject it in my pages, but I can't test it as a regular javascript string.
What's wrong in this ? What have I missed about the 'data' format ? Do I have to 'cast' data to a javascript string (and if so, how ?)
I am currently using $.ajax to post to a Perl file that queries a webservice and returns XML. Running the Perl via command line confirms that XML is being returned with Content-Type: application/xml. However, regardless if I set the dataType parameter to "xml", "XML" or just use jQuery's intelligent guess, it appears that I am not getting any data returned to my function at all.
I've tried using the full $.ajax notation and the simplified $.get notation as follows:
and:
I have also tried using JQuery to perform a "GET" directly to the webservice which returns XML by default and still I get no data returned to my function.
Although I doubt it's browser-related, I have confirmed this in both Chrome (5.0.375) and Firefox (3.6.3).
When I use the ajax function to grab the remote content of some page, I would like to then apply jQuery selectors to that data. Does anyone know how this can be done? Let's say that I just grabbed the content from an html page. I would then like to be able to use a standard: $("#someID").val() to get the content of that page element.
The autocomplete (I'm using this one) and the getJSON work perfectly. The problem comes when I try to do something with the returned json data. Line 14 won't work for me. Any selectors I try on the returned json data won't work. The selectors still work on items that were there before the json data was returned.
This is what I'm attempting at the moment, links is an array. Should this work? I understand that HTML headers cannot contain complex datasets like arrays, so what format is the data sent in? Ie. how do I decompose the array on the PHP end? Or is there a better way entirely of doing this?
I have a function that requires the ability to count the number of entries in an array.
I'm using the following to call my function inside an input tag:
Here is the javascript:
And when errors.length is alerted, it outputs 0. I can only figure that there is an issue when using custom named keys in an array, since this works when I use only integers, however, I have the need to use a custom key index as shown.
I have a problem I have in my controller a function which poperly returns the value (i've checked by var_dump). When I try to access this data from $.ajax it returns nothing...
I'm currently working on a form where an entire HTML page is returned via the .ajax method. I would like to display only the content of the div with the id "content" (of the page returned) in the div with the id "result" (in the calling page). Here is my current script :
I am trying to build a table from backend data and then perform a filter on it using the picnet table filter. After much messing about I have discovered that the problem lies with the table data returned from the server. As a test, all I want to do is get jQuery to make an alert when a table cell is clicked. I added a hard coded table cell at the beginning of the table and when I clicked on it, the alert appeared. However, clicking on any other cell had no effect.
I'm having a little problem with a jQuery/JS script I just wrote in IE7/8. The problem is the first 2 lines of the returned data are not being displayed (w or wo styling) but only in IE. The strange thing is though if I alert the returned data it's there.
I am developing a web application in java (jsp's and servlets). For the project I am working on I will need to develop an html data entry screen and the code to load data into the screen, and then save the data back to the back-end database.
How to do the following: Read the data out of the database (JDBC, no problem) in a servlet. Put the data into the appropriate form for returning to the data entry screen, which will be a jsp. (Is JSON the right choice for passing the data from the servlet to the jsp?)
In the jsp, parse the returned data and populate the HTML form elements (text fields and combo boxes). When a button is clicked, pull the data out of the form elements and return to a servlet for saving back in the database.