JQuery :: Pass Parameters To Selectors/has?
Oct 5, 2009
My button when click call cal function, inside cal function I need to find parent so I can access other element, but I donot know how to pass parameter to Selectors/has(for some reason $("div :button").each(function()... no work here)
Code as below:
function cal(event) {
if (!event) event = window.event;
[code]....
View 1 Replies
ADVERTISEMENT
Dec 14, 2011
I have been checking out the following sitepoint tutorial on creating a plugin using Jquery http:[url]....I have some Questions about the selector and the parameters.Say for example, I wanted to pass parameters into the plugin:
Code:
(function($) {
// jQuery plugin definition[code].....
And conversely if the plugin takes no parameters $(selector).MyPlugin(); Firstly is my understanding correct and secondly what if the plugin doesn't require a selector? What if it doesn't need to do anything to a given DOM element? would it be something like:
$().MyPlugin(someparameters)
View 2 Replies
View Related
Jun 9, 2010
I am trying to remove a title attribute for a link on hover and then add it back on mouse out. I would like to pass var hoverText to the hover out...
[Code]...
View 3 Replies
View Related
Jun 13, 2009
I am trying to pass dynamic String parameter to my javascript. The user enters sdome value and that is passed to the javascript as parameter. My problem is when user enters something of type cs204-1 or cs204.1 etc, the javascript does not run. On passsing simple parameters like cs204 or 111 etc, the javascript works fine. I need to pass any type of parameters to the javascript ( cs204-1 or cs204.1 etc) as I am making this for my college and the values to be entered by the user are of such type. My javascript code is : Code:
[Code]...
I tested the working of the javascript by using alert. It came for normal parameters but not for cs204-1 or cs204.1 types.
View 3 Replies
View Related
Sep 4, 2010
how to pass parameters in the <script ..> tag? for instance;
<script type="text/javascript" src="script.js?param1=val1¶m2=val2&etc">
in the javascript script.js, how would we read the params after the question mark? for example, google this; google shopping cart /v2_2/cart.js
View 7 Replies
View Related
Jun 13, 2009
I am trying to pass dynamic String parameter to my javascript. The user enters sdome value and that is passed to the javascript as parameter. My problem is when user enters something of type cs204-1 or cs204.1 etc, the javascript does not run. On passing simple parameters like cs204 or 111 etc, the javascript works fine. I need to pass any type of parameters to the javascript ( cs204-1 or cs204.1 etc) as I am making this for my college and the values to be entered by the user are of such type.
My javascript code is :
function deleteQuestion(id){
alert(id);
questionId= eval("document.form1.deleteQ"+id+".value");
url='/DeleteQuestionServlet?questionId='+escape(questionId);
document.form1.action=url;
}
I tested the working of the javascript by using alert. It came for normal parameters but not for cs204-1 or cs204.1 types.
View 1 Replies
View Related
Jul 23, 2005
I have an easy question, likely, that has me in a headspin. I have an
include file to a frames based site that basically forces frames on
the end user if they visit the site and hit a non-frames created
page...
Simply, it is:
if (parent != self)
self.parent.location.replace("/");
However, now I would like to force an inner frame to populate based on
what frame someone was redirected from the include (above). So, if I
visit http://domain/frame/innerframe_3.html, then I want to redirect
to the above, but pass in /frame/innerframe_3.html to be included as a
URL parameter for an inner frame to be populated.
When I modify this link to:
if (parent != self)
self.parent.location.replace("/index.php?redir=" & location.href);
Then, the replaced location doesn't seem to recognize the ?redir=
portion of the new location.
Is there a different way to do this? I can't use a META tag because I
want the TARGET to be _TOP, basically.
View 3 Replies
View Related
Sep 15, 2009
Hi all.Am new to this forum so cut me some slack if I don't articulate my problem with utmost clarity.My problem is that I have a javascript function such as:
function modReg(x,y)
{
<!--
var answer = confirm ("Do you really want to deregister user" +x+"?")
if (answer)
{
document.leo["id"].value=x;
[Code]...
Now, leo is a hidden form with the 2 fields namely "id and "two".Viewing source, I see that the parameters I need are well acquired by the function.In next page, I haven't been successful at retrieving the passed parameters.
View 9 Replies
View Related
Apr 12, 2010
I am having some issues with getting a variable from an onclick event with javascript.
$('#preview_logo').append('<img src="'+fileObj.filePath+'" height="100px" hspace="5" /> '+fileObj.name+' uploaded.<a href="javascript:;" id="dele_image" onclick="del_image('+fileObj.filePath+','+fileObj.name+');">Upload Different Image</a><br>');
This is for uploadify script for previewing an image that is uploaded, it creates the link fine, but won't trigger the function "del_image" unless I delete the parameters in the onclick, which leads me to believe it is something to do with my quoting. Here is the function:
[Code]....
View 7 Replies
View Related
Feb 22, 2010
I am passing parameters via URL to my HTML form. The hardcoded hidden values work. Does anyone know how I can modify this so that the parameters can also write to the hidden values?code...
View 3 Replies
View Related
May 30, 2010
I want to pass two parameters on button "b" click. how to pass parameters on b.onclick = test function?
function test(x, y){
alert(y);
}
var b = document.getElementById('b');
b.onclick = test; //how to pass x and y parameter?
View 5 Replies
View Related
Jun 12, 2011
I have a code set up something like this:
[Code]....
The problem is I keep getting an error along the lines of: TypeError: Result of expression 'house' [[object Object]] is not a constructor. It seemed to work when I wasn't passing the other objects as parameters in the constructor. I just created and assigned them later. As in:
[Code]...
View 4 Replies
View Related
Sep 23, 2010
I need to open a popup window from a PHP site and pass in some parameters to use in the pop up window. I have the params in an input box and need to get the val of the box into a param and pass it to the new popup window. All pages are local and in the same folder. The id of the input box is 'ddutykey'. The name of the new window would be showduty.php if possible.
View 3 Replies
View Related
May 21, 2010
How can i select immediate children of an element only. Like i have
<div class="widget">
<ul>
<li><a href="google.com">Google</a>
[code]....
View 1 Replies
View Related
Oct 12, 2009
Writing a sortable list function. My <li> elements contain several items (headings, paragraphs etc) and I want to add a class to the headings when they've been sorted. I have this code in my sortable init:
receive: function(event, ui) {
$(ui.item).addClass('editable');
},
This adds class="editable" to my newly-sorted <li> element - cool. What I want, though, is to add this class to the <h3> within my <li>. I tried:
receive: function(event, ui) {
$(ui.item + ' h3').addClass('editable');
},
but this just gave a syntax error.
View 3 Replies
View Related
Apr 23, 2009
I found that certain selectors work in all browsers except IE 8 and they need to modified. This selector pattern seem to work well in all browsers, including IE 8: jQuery("input[class='class_name'][type='text']") But this identical selector works in Firefox, Safari but not in IE 8: jQuery("input.class_name:text") In IE 8 it returns a "property not found" javascript runtime error. I don't know whether that the actual issue or if it is a side effect of some memory leak.
View 1 Replies
View Related
Apr 29, 2011
I'm trying to test if certain radio buttons are selected, but the name varies. My boss is considering changing the names to further isolate them breaking the script as it works now. I'm trying to figure out how to test the new case just like it works now. Here's a link to my pastebin
View 6 Replies
View Related
Nov 28, 2011
I am trying to assign a click event handler to any of the <a> elements in the code below:
<div data-role="content" id="picSpace" class="ui-content" role="main">
<div class="ui-grid-b" id="gamePics">
<div class="ui-block-a">
[code]....
View 5 Replies
View Related
Apr 4, 2009
Can I do this:
function showDiv(curEl){
hideDiv();
$(curEl).css("visibility","visible");
}
View 6 Replies
View Related
Apr 9, 2011
While trying to get a selector to work with ids that include square brackets, I searched the forum and found that I needed to escape the brackets with '\'. However, while this works with my fiddle: can't get the exact same selector to work within my page in either FF or Safari. I've triple-checked the id and it is correct; I know that jQuery is working on the page because changing the selector to$('.nameinput') gives the expected results. can't change the id because I'm working within an existing application; I know I could add a class to the input and use that as the selector instead. I'd prefer not to and would just like to figure out why this isn't working.
View 1 Replies
View Related
Feb 22, 2010
I have a page that has several embedded usercontrols with a popup reorderlist. Like
[Code]...
isthis the correct approach and if so what should the 'fld1' line look like to pull this data.
View 1 Replies
View Related
Jul 27, 2010
Is there a way to combine selectors with && condition. eg: $('.classname div[att=value]') Requirement is to select all div elements with class 'classname' and (&&)an attribute 'att' whose value is 'value'
View 2 Replies
View Related
Dec 30, 2010
What I'm trying to do is quite simple but as a beginner I'm getting incredibly frustrated with it. Here's my first attempt. I plan to do something a bit more fancy with the images, but I could see straight away that this wasn't the solution. Mouseover was changing the image before it had faded out and looked horrible. So, I thought I might put all the images in the same place and hide them, making them visible and bringing them to the front on mouseover of the corresponding hotspot.
[Code]...
View 6 Replies
View Related
Feb 18, 2010
I have the impression $('h1:after') e.g. doesn't work. How to manipulate these pseudo selectors with jQuery?
View 1 Replies
View Related
Jun 4, 2009
I'm trying to do is simple "select all" checkbox script. The problem is, no matter what I seem to do, only first element is matched. $("input:checkbox").attr("checked", true); checks the first box only. Same with: $("input:checkbox").each(... I even tried copying this script directly from the jQuery documentation page: $("div").css("border","9px solid red"); It applies a red border to the first div on my page.. the example in the documentation applies it to all divs.
View 5 Replies
View Related
Jul 1, 2010
Ok, this seems easy, but I am struggling. I have this...
$("a[href$='mp4']").click(function () {
But I want it to work for mp4 or mov or more. Something like...
$("a[href$='mp4'||href$='mov']").click(function () { <-- which doesn't work apparently
View 2 Replies
View Related