JQuery :: Pass A Selector Into A Function?

Apr 5, 2010

I am attempting to hack a jQuery extension that does an ajax style form submit. The final result is an image uploader that can run inline. The script is fairly simple - it creates an iframe with a new form, and copies over a form element (the file name), and submits the form. Plus error handling and the like.

The problem is that I need to use from within MVC, and so I need more form values, like the ID of the item I am working on. It would be easy to add another configuration setting for an additional form element to copy over, but I really want to have the ability to pass a jQuery selector in and use that to specify the form elements to copy. Is this possible?

View 3 Replies


ADVERTISEMENT

JQuery :: Cannot Pass A Variable To Selector?

Aug 5, 2010

I am trying to use (multiple) attribute selector and I have a string variable "txt" that I need to use in the attribute selector to select all <p> with all id's except for the id=txt

$(document).ready(function(){
$("p.par").click(function(){
txt = $(this).attr("id");

[code]....

View 2 Replies View Related

JQuery :: Cannot Pass A Selector Via A Variable?

May 14, 2009

im trying to figure out how to pass a target selector via a variablethe simple example below dosnt work, i was wondering why when i pass the varible target into the slector it does not work...

var target = "#1 .preview";
$(target).addClass("hidden");

View 1 Replies View Related

JQuery :: Pass A Variable (which Is A Number) To The :gt(index) Pseudo-selector?

Mar 27, 2010

I am trying to pass a variable (which is a number) to the :gt(index) pseudo-selector.var thisParentIndex = $(this).parent().index(); //get the index of parent

console.log(thisParentIndex);
$(this).parent().parent().find('div.line:gt(' + thisParentIndex + ')').hide();

this does not appear to work..

View 3 Replies View Related

Pass Id Selector Content To A Variable?

Jul 16, 2011

Can I pass the content of an id selector to a variable?I am using a jQuery plugin which passes some data to an id selector ('#alt-text'). If I create a div tag with that id, the content for ('#alt-text') gets displayed in the div tag- everything fine. However, I need to split the selector (or parse the selector) to the assign different sections of the data to differnt div tags.

can't seem to get this started. If I try:
var xxx = $('#alt-text');
$('#otherDivTag').html(xxx);

it does not work. My desire is to do something like:

var xxx = $('#alt-text');
$('#otherDivTag').html(xxx).text().split(' ')[0];

View 3 Replies View Related

JQuery :: Passing Value From Function To Other Function Selector

Feb 18, 2010

I have issue with passin value between functions:

$(document).ready(function(){
id = 'test';
$('#Meno').keyup(function(){
id = '#Mobil';

[Code].....

I am getting from console.log right value "#Mobil" but $(id) has value "Test". I need there also value "#Mobil".

View 2 Replies View Related

JQuery :: Selector String - Add Click Function For All

Jul 9, 2010

Not sure what would be the best way to do this. I need to add a click function for all :submit and :button that are not disabled or have an alt text of no-touch.

View 6 Replies View Related

JQuery :: Pass ID # To Function In Order To Use One Function Instead Of Separate Ones?

Oct 1, 2010

I am trying to minimize the amount of script that I use on my website. I have sections of each page; each section has the same basic layout. The divs and images that I want to make appear and disappear all have nearly identical ids, the only difference is the number at the end of the id.Is there a way to get one script to automatically detect which id number has been clicked and then show all elements with the same number at the end of the id? I would also like it to hide the elements in the hide function below (basically they are the elements that do not share the same id number).I currently have everything working the way I want it to using multiple functions like the one below but I woul

$("#2thumbNail2 , #ledBar").click(function () {
$("#type201 , #type203 , #type204").hide();
$("#image201 , #image203 , #image204").fadeOut("slow");

[code]....

View 1 Replies View Related

JQuery :: .attr (selector / Function) Does Not Change Browser Held Source Data

May 31, 2011

I'm attempting to make a simple hover image gallery with a static large image which swaps with a thumb on hover. However, on hover what happens is the new image comes up as the large image and if I then hover over another thumb it replaces that thumb with the original bigpic image source.

View 2 Replies View Related

JQuery :: Difference Between Class Selector And ID Selector?

Sep 8, 2011

Are there any difference between class selector and ID selector

View 2 Replies View Related

JQuery :: Pass An ID To The Function?

Jul 28, 2010

I have a list of items and a link to delete one at time. I've build this confirmation delete script but it works in a wrong way: it takes the last item.

<html>
<head>
<link rel="stylesheet" type="text/css" href="css/redmond/jquery-ui-1.8.2.custom.css">

[code]....

View 4 Replies View Related

JQuery :: Pass Different IDs To Function?

Aug 18, 2009

I'm very new at jQuery, and I've gotten myself stuck.I have a set of menu tabs which should show/hide divs on the page, and the active tab should change style.[code]

View 4 Replies View Related

JQuery :: Pass A Variable To Function?

Apr 19, 2011

I am creating a testimonial/quote rotator using the following function:

[Code]...

View 2 Replies View Related

JQuery :: Pass A Dynamic DIV ID To A Function?

Apr 27, 2010

I got a problem with passing dynamic DIV ID. I was doing some a php page which retrieved data from database and put into according DIV tag like this:

<DIV id="variabl1">msg1</td>;
Since there were tens of records in the table in database, the result would become:
<DIV id="variabl1">msg1</td>;
<DIV id="variabl2">msg2</td>;
<DIV id="variabl100">msg100</td>;

I got a JQuery script to show a specific message when a user moved his mouse over a DIV,
say if he moved his mouse over DIV ID 1, a msg would pop up showing message.

[Code]...

View 1 Replies View Related

JQuery :: POssible To Pass ID As A Parameter For A Function?

Mar 23, 2011

I've been struggling with a piece of code. I'm guessing the solution is quite simple, but I just can't find it! [code]...

The line that I commented out was an attempt at getting a variable that had the value of the image-id, but it doesn't work.

View 4 Replies View Related

JQuery :: Call A JS Function By Pass Into A JS?

Jun 19, 2009

i want pass a JS function name into a function and call it.

<a onclick="javascript:ajax_loadpage('inittabFeeds()');">babababa</a>
function ajax_loadpage(x_func)
{
// how can i call inittabFeeds() which stored in x_func variable ?
}

View 4 Replies View Related

JQuery :: Pass Object To Function?

Jan 6, 2010

I have a function which controls my interface. If people click on alink with the class 'less' i would like a dive to slide up.My code roughly looks like this:

$
"a.less"
.livequery

[code]....

View 6 Replies View Related

JQuery :: Pass A DIV ID To A Self-defined Function?

Apr 27, 2010

I am writing a simple html in which when the user moves his mouse over a particular DIV, a message box will pop up.

Part of the code is as follows:

<DIV id="1">Hide them</DIV>
<p>Hiya</p>
<p>Such interesting text, eh?</p>
</td></tr></table>

[Code]....

I dont know how to pass a DIV's ID to a self-defined function in JQuery.

View 2 Replies View Related

JQuery :: Pass Id To Delete Function

Oct 16, 2011

How do I pass the ID of the selected row to the delete function, "function Delete(ID)",when the user clicks on the Delete link below? [code]

View 13 Replies View Related

Jquery :: Pass Value To Click Function?

Jun 30, 2010

I would like to pass value to click function in JQuery. How to do that ?

I want to send the ID value of the HTML element to the click function when the element is clicked.

whats the syntax ?

View 1 Replies View Related

JQUERY :: Pass Id Of Anchor To Use In Function?

Jun 24, 2009

I was wondering if someone could help me with this. I want to, when an anchor link is clicked, the id of the link is grabbed by jquery then passed to a function. The id is would be the same as the id of the div that is used for the function (highlight).

[Code]...

The code is a little messy but I am just testing right now. So if someone clicks on #aq1 link the id "aq1" is grabbed and used for the highlightFade function. It would highlight the div with id "aq1".

View 3 Replies View Related

Call Function In Script And Pass One Parameter To Function And Its Returns String Value?

Feb 15, 2012

I want to call java function in javascript.In which we pass one parameter to function and its returns String value which I want to display in alert message.

View 2 Replies View Related

JQuery :: Pass More Than 1 Parameter To Click Function?

Jun 10, 2010

I currently have the following:

<a href="#" id='$dbase'>Link</a>

which passes the value of $dbase to my jQuery click function.

But I'd like to also pass a second parameter consisting of a page number. Can that be done using the click function or would I have to do it another way. I'm assuming it must be possible. I suppose i could always concatenate the two parameters, e.g. $dbase-$pagenum, pass that and then split it in the javascript but that seems a slightly inelegant way of doing it.

View 2 Replies View Related

JQuery :: Can't Pass Function As A Parameter And Call It

Aug 2, 2011

I'm trying to pass locally defined function as aparameter. Every time I do it, it causes an error saying something along the lines of "there is no conversion for text to function".

$(document).ready(function(){
jQuery("#confirm-ajax-submit").click(function(event){
var success = function(){
alert("this is what I want to see.");

[Code].....

View 5 Replies View Related

JQuery :: Execute/Run A Function After 1.8 Seconds Pass?

Feb 8, 2011

I was wondering if someone can help me write some jQuery that would be executed after 1.8 seconds pass. Well what I want to be executed is all div tags to be shown. As$(document).ready(function() {
("div").show();});would show all div tags when the document is loaded.Is there a way I could do something like what I have written inpseudo-code$(document).wait("1800", function() { ("div").show();});

View 1 Replies View Related

JQuery :: Pass A Parameter When Set The Function For An Event?

Jan 22, 2010

Ok this is my first day with JQuery, so I know I'm probably asking a stupid question; But, given the following code, how do I pass a parameter when I set the function for an event.

var url = $("#deleteBlog").attr("href");
$("#deleteBlog").click(deleteBlog);

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved