I know this is not a completely new question, but none of the answers solved my problem...
I have built a little menu that uses load() to load image galleries (as external html files) into a specified div ("content"). The said galleries make use of a JQuery plugin (SlideJS).
Now I know that load() does not work for script tags and that I need to use $.getscript in the callback function in order to run the scripts, but it does not work. I have two .js files that need to be loaded: one is the plugin itself and another one is a smaller script with a preloader and the animations for the captions.
I can't seem to merge them together; if I put them into the same document, the script won't run. So I tried just using $.getscript to load the two files.
I tried using two callbacks as suggested in other answer (I know it's not ideal...):
$("#proposal").click(function(){
$(this).addClass('selected');
$("a:not(:#proposal)").removeClass('selected');
$("#content").load("works/proposal/proposal.html", function(){
$.getScript("js/slide.js", function (){
$.getScript("js/slidepage.js");
});
});
});
and I tried a variable (read about it in some other faq, not sure if the syntax is correct)
$("#proposal").click(function(){
$(this).addClass('selected');
$("a:not(:#proposal)").removeClass('selected');
$("#content").load("works/proposal/proposal.html", function(){
var scripts = ['js/slide.js','js/slidepage.js'];
$.getScript(scripts);
});
});
So none of these work. What am I doing wrong? I'm just starting on jquery and my js knowledge is very limited. Should I just merge the two .js files together using minify or something? One of them is already minified, but I've tried with a non-minified version and it does not work either.
Can anyone suggest any other solution around this problem? I thought of just having the div embedded in the main document and just showing it on click, but I'll have at least 4 galleries with about 8 to 10 images each... its a lot of images to load in the main page, so I don't think its the best way.
if you need me to post any more code, please ask! Thanks in advance for all your help!
JQuery
Assume this works: $('table td').load('/my/url/ div p');
I would end up with <td><p>Some Text</p></td>
I want to end up with <td>Some Text</td>
How would I do that?
I've created a jQuery slider on my site using the Nivo Slider whihc is available at http://nivo.dev7studios.com/ . I'd like to have the ability to add in the images + links via a form so that I may create a featured content area. Any help is appreciated.
I am trying to find the correct syntax to pass a varible to my JQuery Post.
var id = empid;
$.ajax({
type: "POST",
url: "../Webservices/EmployeeService.asmx/GetEmployeeOrders",
data: "{empid: empid}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(result) {
alert(result.d);
}
I don't think the data: value is quite right. Someone set me straight?
Thanks!
I have recently done a very simple highlighting with jQuery and a highlight plugin. It looks like this:
$('myButton').click(function() {
$('body').highlight($('#myInputText').val());
});
But I wonder how can I do the Chrome like highlighting, I mean highlight the letters whenever I type in some letter in textbox without submitting. I think maybe use a keyup event... Any ideas?
Hi,
I'm very new to JQuery, but I was told the one of the cool things about it is you can query a mysql database right from an html page(or in my case a smarty template)with out needing php.
I have not found any examples of this so I am asking if someone has one? Thanks
Heya,
I have just implemented the excellent jQuery UI autocomplete.
http://jqueryui.com/demos/autocomplete/
There is a strange bug in IE 8 (and maybe other versions).
When you select an item from the box of suggestions in IE 8 the cursor moves to the begining of the textbox before the suggested word which has just been inserted.
Firefox put the cursor after the inserted word.
Does anyone know of a fix for this?
Regards
Steve
I have a aspx page (details page) that needs to be loaded in a modal window on a click of a button. I have buttons in the aspx page that calls server side functionality. So, this is similar to an IFrame way (except that it's now in a modal window)
Is there a JQuery way of doing this?
What does jQuery do differently when you specify the datatype as html as opposed to text. I haven't seen a difference but there must be some subtleties I'm missing. If I wish to return a portion of an html page as a string does it matter which I use?
Hi,
I have a page with many panels. each panel will have around 5 textboxes.
I need to disable all the textboxes which are empty when the page is loaded. Want to acieve this using JQuery. Can somebody help me on this?
Hi ,
Am using this
jquery plugin]1
How to change the click mode to automatically run mode ,
Present scenario , When u click NEXt it show the next three image,
When u click BACK It shows the previous three images ,
I want to change this scenario to
Whe loads , the plugin should start running(image) , Also i need the NEXT and BCK button , When user click the back button , then it show show previous three image and run image toward back,
Is it possible in this ?
Thanks
amount
A. 2
B. 3
C. 3
Quantity
A. 4
B. 5
C. 2
Total
A. 6
B. 8
C. 5
sum(19)
i need some idea of script and method of jquery to make this simple i have already done the edit function of amount and Quantity. but its really hard for me to sum up the amount + quantity = total and sum(total). any idea guys? :(
{"paging": {"pageNum":2,"action":"Next","type":"","availableCacheName":"getAllFunds","selectedCacheName":"","showFrom":101,"showTo":200,"totalRec":289,"pageSize":100},
"Data":[{"sourceCodeId":0,"radio_fund":"individua
l","availableFunds":[],"fundId":288,"searchName":[],"fundName":"Asian Equity Fund A Class Income","srcFundGrpId":"PGI","firstElement":0,"las
tElement":0,"totalElements":0,"pageList":[],"standardExtract":true}]
I have json file with above format with two fileds,one paging and one is Data array.
I able to retrieve values of paging,but i am not able to retrieve the values of data array with .each function of jquery.
Any suggestions or inputs really appreciated.
I know this exists out there, somewhere but I haven't found it in a few hours of searching. I simply have to load a clients external page into an IFRAME, but I want to use jquery ui to present the loading image while it's grabbing the external data.
Simple yes, but I've seen pieces of this not the whole thing.
hi my dear friends ...
How can I change the visibility of a control with jQuery? I have a control that its visible property to false...(not css)
When I used show() function for it nothing happened, it seems that hide() and show() methods are for css set of a control , not visible property...
Thanks for your answers,
Best regards
In jQuery how can I track onchange event if the value of textbox is changing dynamically from some other event. I tried this but its not working:
$("#txtbox").change(function(){
alert("change");
});
I am using jquery to find a first element having a class "error" applied to it using the below code
$('#mainDiv input.error:eq(0)')
But the above one working only for input elements only.
How to make this one to work for both input and select elements?
Me again,
I have a question I would like to ask as a followup.
to submit a form using a link powered by jquery is what I am curious about. do I just bind a click event to the link in the live() event for eg and use a submit() added to the click?
God bless
How can I get the selected value of a dropdown box using jQuery?
I tried using
var value = $('#dropDownId').val(); and
var value = $('select#dropDownId option:selected').val();
but both returns an empty string.
If i submit my ajax form from jQuery, and do
print_r($_FILES);
i get a list of files uploaded,
but if i do something like this
$add_form->sound_file->isUploaded();
or
$params = $this->_getAllParams();
print_r($params);
i don't get my file in zend parametars, and i don't get it uploaded!?
Mayb the problem is with he context beng ajax?!