I need this video to play automatically. It would be nice, this code can play videos from other sources like yahoo etc.. Is it also possible to use HTML5, instead of jquery?
What I have to work with:
An html table 5X7. On many queries, there are less that 35 items filling the complete table.
How can I "hide" the empty cells dynamically in this case, using jQuery (or any other efficient way)?
Thank you.
Here's my situation:
I'm writing an ASP.net MVC 1 website and I have a create/edit form that uses the default model binding to parse the form into a strongly typed complex object.
The object I'm posting has a child collection of another complex type and the way I format my id's for the model binder is as follows:
<div class="childContainer" >
<!-- There's one of these for each property for each child collection item -->
<%= Html.TextBox("ChildCollectionName[0].ChildPropertyName", /* blah blah */ ) %>
<%= Html.TextBox("ChildCollectionName[0].OtherChildPropertyName", /* blah blah */ ) %>
<!-- ... -->
</div>
This gets rendered as
<div class="childContainer" >
<input id="ChildCollectionName[0]_ChildPropertyName" ... />
<input id="ChildCollectionName[0]_OtherChildPropertyName" ... />
...
</div>
<div class="childContainer" >
<input id="ChildCollectionName[1]_ChildPropertyName" ... />
<input id="ChildCollectionName[1]_OtherChildPropertyName" ... />
...
</div>
For each entry in the chlid collection.
This collection is dynamically created in the form using jQuery, so entries can be added, removed etc. and whenever there's an operation on the collection I need to update the indexes so that it's bound correctly on the server side.
What's the best way to replace all the html input id's when I'm updating the index within the child e.g.
replace all [*] -- [N] where N is the correct index.
using jQuery / JavaScript ?
I have something coded now, but its buggy and I think there is a simpler solution.
Also, if you have an easier way to identify the child collection I'll take any advice on that as well.
Thanx!
I'm unable to get this script to work as an extension in google chrome. No alert shows up. normal javascript alerts work.
// ==UserScript==
// @name voip
// @namespace 1
// @description voip
// @include *
// @require http://jquery.com/src/jquery-latest.js
// ==/UserScript==
$(document).ready(function() {
alert("Hello world!");
});
jQuery 1.4.2's animate() API spec is
.animate( properties, [ duration ], [ easing ], [ callback ] )
but it seems that we can supply duration, callback, and no easing
.animate({left: '+= 100'}, 600, doThis)
and it will work.
But if we supply easing and callback and no duration
.animate({left: '+=100'}, 'swing', doThis)
then the easing won't be taken into effect. So what exactly is the API supposed to be?
if (pathname == "/" || pathname == "/default.asp")
in js using jquery library.
I want this to catch "Default.asp" as well as "DeFaULT.asp" and "default.asp"
halp.
hi,
I'm using jQuery Media module in Drupal to use my own flv player. It works great, however I would like to assign different width and height size according to the videos sizes.
How can I do it ? Should i pass back values from Flash app with an External Call ?
thanks
I want to make my component faster, I am using Javascript and JQuery to build that.
I am using JSON object to communicate with component and back-end is python.
Is there any suggestion to make component faster?
Consider a hiddenfield in the page HfId
<input type="hidden" id="HfId"/>
How to assign,clear and get value of a hidden field in jquery? ANy suggestion...
Whenever I load ONLY the 1.3 or 1.4 library on an html page im developing on my desktop I get an error that says "setting a property that only has a getter"
I dont have any additonal code, this is coming straight from the jquery.min.js file
I also get a bazillion warnings in Firebug.
Can someone help me resolve this issue?
I can't determine why this is happening
This is my first time building a tool like this, so please bare with me. I'm doing this to learn more about jQuery and AJAX.
Basically, I have a search input and a hidden div. When you start typing in the search input, the hidden div becomes visible and results are brought in. In this case, I'm searching for client names.
It all works fine, however I think my code could be better but I'm not sure exactly where to begin. Each keyup requests a PHP script which accesses a table in a database to find a like string. But in my PHP script, I'm echo'ing some JS/jQuery which I'm not sure is good practice. Below is my code. Am I going about this the right way or am I totally off base? Any suggestions for improvement?
Javascript
$("#search").keyup(function() {
$("#search_results").show("fast");
$.ajax
({
type: "POST",
url: "http://localhost:8888/index.php/welcome/search/" + $("#search").val(),
success: function(html)
{
$("#search_results").html(html);
}
});
});
PHP
function search($search_string = false)
{
if ($search_string)
{
$this->db->like('name', $search_string);
$query = $this->db->get('clients');
if ($query->num_rows() == 0)
{
echo "No client exists.";
}
else
{
foreach ($query->result() as $row)
{
echo '<script>';
echo '
$("#client_results_'.$row->id.'").hide();
$("#'.$row->id.'").toggle(function()
{
$.ajax
({
type: "POST",
url: "http://localhost:8888/index.php/welcome/search_client_ads/" + '.$row->id.',
success: function(html)
{
$("#client_results_'.$row->id.'").html(html).show("fast");
}
});
}, function()
{
$("#client_results_'.$row->id.'").hide("fast").html("");
});';
echo '</script>';
echo '<p><span id="'.$row->id.'">'.$row->name.'</span></p>';
echo '<div id="client_results_'.$row->id.'"></div>';
}
}
}
else
{
echo '';
}
}
function search_client_ads($client_id)
{
$query = $this->db->get_where('online_ads', array('client' => $client_id));
if ($query->num_rows() == 0)
{
echo "No ads exist.";
}
else
{
foreach ($query->result() as $row)
{
echo $row->id;
}
}
}
I'm unable to get this script to work as an extension in google chrome. No alert shows up. normal javascript alerts work.
// ==UserScript==
// @name voip
// @namespace 1
// @description voip
// @include *
// @require http://jquery.com/src/jquery-latest.js
// ==/UserScript==
$(document).ready(function() {
alert("Hello world!");
});
I have a string in my db I want to pull into my page and convert to a json object.
[
{id: 1,title: "Long Event",
start: new Date(2009, 5, 6, 14, 0),end: new Date(2009, 5, 11)},
{id: 2,title: "Repeating Event",
start: new Date(2009, 5, 2)},
{id: 3,title: "Meeting",
start: new Date(2009, 5, 20, 9, 0)},
{id: 4,title: "Click for Facebook",
start: new Date(2009, 5, 27, 16),end: new Date(2009, 5, 29),
url: "http://facebook.com/"}
]
How can I do this using JQuery?
One of the common things I've seen done in applications built on IoC/plugin frameworks is to add commands to menus or toolbars from the dynamically loaded plugins. For example, the application's default plugins supply actions like "New, Open, Save" that show up in the context menu for a certain item in the workspace. A new plugin may add "Mail, Post, Encrypt" commands, but where do those commands show up in relation to "New, Open, Save"?
How can the application that is loading components through IoC impose order on the items that get injected?
Does it require metadata from the plugins that give a hint on how to group or order the items?
Does it use a config file of previously known menu names (or ids) to define the order (seems a little weak to me)?
Or are "unknown" plugins treated as second class citizens and always get dumped into sub menus?
Something I've never even imagined (which I'm hoping to see in the answers)
While John Resig's recommendation is, quite rightly, to declare all events within a jquery.document.ready() function, I know that you don't actually have to put everything in there. In fact, there are cases where it may be more appropriate to deliberately put methods outside of the ready event.
But what are those cases? Obviously best practice dictates that all events are declared within the ready event, so what would best practice be for declarations outside that event?
Is there a way using jQuery or Javascript to force a page to open in Firefox? For example, if the user has their default browser set to internet explorer, but they have firefox on their computer - open a new firefox window with the intended page. If so, I would need to check to see if they have firefox on their machine; otherwise, redirect to the mozilla firefox download site...
any suggestions?
I have a scenario where-in I need to create an uber jar of a multi module maven project including all modules and their dependencies. I tried using maven shade plugin. but it seems to work only when I use it at the module level. If I add the plugin entry in parent pom then the build breaks (it tries to shade the parent pom)
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing null with C:\Projects\foo.bar\target\foobar-0.0.1-SNAPSHOT-shaded.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error creating shaded jar: null
It does seem to make sense since the <packaging> for the parent maven project is pom.
But there should be some way to create an uber jar for a multi module project... Any ideas people???
Hi,
All I have a Span in side the Form view. I wanted to Call a Jquery Fucntion when the from load how can i do this?
Thanks
Waiting for your reply
here is my code
<asp:FormView ID="FormView1" runat="server" OnItemCommand="FormView1_ItemCommand">
<ItemTemplate>
<asp:HiddenField ID="hidProductID" Value='<%#Eval("ProductID") %>' runat="server" />
<asp:HiddenField ID="hidCustomerID" Value='<%#Eval("CustomerID") %>' runat="server" />
<a href='<%=WinToSave.SettingsConstants.SiteURL%>WintoSave/AuctionProduct.aspx?id=<%#Eval("ProductID") %>'>
<%#Eval("ProductName")%>
</a>
<br />
<img src='<%#Eval("ImagePath")%>' alt="Image No available" />
<br />
<asp:Label ID="lblTime" runat="server" Text='<%#Convert.ToDateTime(Eval("ModifiedOn")).ToString("hh:mm:ss") %>'></asp:Label>
<span id='Countdown_<%#Eval("ProductID") %>' onload="GetTimeOnLoad('<%#Eval("ModifiedOn")%>','Countdown_<%#Eval("ProductID") %>');"></span>
<br />
<asp:Label ID="lblFinalPrice" runat="server" Text='<%#Convert.ToDouble(Eval("FinalPrice")).ToString("#.00")%>'></asp:Label>
<br />
<asp:Label ID="lblFullName" runat="server" Text='<%#Eval("FullName") %>'></asp:Label>
<br />
<asp:Button ID="btnAddbid" Text="Bid" CommandName="AddBid" CommandArgument='<%#Eval("ID")%>'
runat="server" />
</ItemTemplate>
</asp:FormView>
and following is my jquery code
function GetTimeOnLoad(shortly,DivID)
{
var dt = new Date(shortly);
alert(dt);
alert(shortly);
alert(DivID);
var ProductDivID = "#" +DivID;
alert(ProductDivID);
$(ProductDivID).countdown({
until: dt, onExpiry: liftOff, onTick: watchCountdown,
format: 'HMS', layout: '{hnn}{sep}{mnn}{sep}{snn}'
});
}
function liftOff(){};
function watchCountdown(){};
In above code I Used
' onload="GetTimeOnLoad('<%#Eval("ModifiedOn")%','Countdown_<%#Eval("ProductID") %');"
but is not working
In jQuery//dialog you can make a button like this:
dialog({ buttons: { "Ok": function() { $(this).dialog("close"); } } });
Can I make this button with a hyperlink to somewhere instead?
Hi!!
I have a form and the "Name" input text is using jQuery autocomplete. What I needed was when I select a name in the list result of autocomplete, I fill the other input texts (date of birth, telephone etc) based upon the name selected.
Does anyone know how to make this second ajax call after a name is chosen?
thanks!!
I have to copy repeatedly data (contact info such as name, surname, telephone...) from form A (page 1 in domain x.com) to form B (page 2 in domain y.com)
I have been thinking about creating a chrome extension with the help of jquery to copy the data from form A, and inject it form B...
I have a feeling that this is not the best way to solve this problem...
What do you think is the best way to copy and paste data from pages in different domains?
Hi,
I would like to catch a click event with jquery and be able to tell if a key was pressed at the same time so i can fork within the callback function based on the keypress. for example:
$("button").click(function()
{
if([KEYPRESSED WHILE CLICKED])
{
do something...
} else {
do something different...
}
});
Does anyone know if this is possible at all or how it can be done if it is possible?
I am using jasmine-maven-plugin to run javascript unit tests for my dojo widgets. One of my dojo widgets refers to a html template jsp file with taglibs. When I initialize my dojo widgets, I get the following error:
Error: Invalid template: <%@ taglib uri="http://www.springframework.org/security/tags"
prefix="sec"%
The plugin uses jetty to deploy the scripts to test. I tried including jstl jar into the WEB-INF folder but it doesn't work. I am assuming it's just not DOJO and this taglib issue can occur even with simple js file. I am looking for some clue on why taglibs are not recognized here. If I remove the taglib entries, my tests just work fine.
This is what I currently have:
// #content is visibility=hidden
sIFR.replace(mix_bold, {
selector: '#content p',
onReplacement: function(fi) {
$('#content').fadeIn("slow");
}
});
The fade in happens, but for a split second the replaced flash movie appears before being hidden. Has anyone gotten this to work? I am using jQuery 1.2.6 and sIFR 3 r436. Tested in Safari 4 and FF 3.
Thanks!