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.
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!");
});
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 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?
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?
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!");
});
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?
In our project we use plugin for jQuery - Galleriffic (http://www.twospy.com/galleriffic/), it allows you to do slideshow with photo set.
How to hide buttons prev/next in "pagination" block?
In the navigation ("pagination" block) should be only the page numbers without buttons prev/next.
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?
Hi Folks,
When you click the "Click an element on the page to inspect" arrow with FireBug, it puts a Blue Border around the target element, and also returns the DOM Id.
I am building an application and that feature would be awesome to add. Be able to hover over elements and highlight the target, upon clicking return the DOM Id or CSS selector to the application.
Is there a jquery plugin that does this magic? Some other smart way?
Thanks!,
Jonathan
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!
How do I simulate a scrollbar click with jQuery? So, if a user clicks on a div that says "scroll down," it'll be the exact same behavior as if he/she clicked on the down arrow of the browser's scrollbar. Using the current browser's behavior would be optimal, vs. doing something like $.browser.scrolldown(200,'fast').
Something like $.browser.triggerDownArrowOnScrollBar() would be sweet!
Hi Im using jQuery fade in/out on divs which contain images and text. It works fine in Firefox, Chrome and Safari however the effect doesn't appear to work at all in any Internet Explorer. The image disappears on fadeout the number of milliseconds I specified, but it doesn't fade.
Are there any special rules for using this in Explorer?
If I load an html fragment that contains images with jquery's .load(), the images aren't yet loaded when my callback is called. Since I need to do some calculations based on the dimensions of the images, I need to know when they've actually been loaded. Is there a nice way to do this?
I'm making a slideshow and the images won't be static, they'll be pulled in dynamically through an array and finally it will look like this:
What i'm wondering is, what is more CPU friendly, CSS3 & jQuery making transitions fade simply by changing the CSS class of the div that will fill the screen, or, Canvas with drawn on it refreshing each time?
I'm trying to load one page into another using the .load() method. This loaded page contains a script that I want to execute when it has finished loading. I've put together a barebones example to demonstrate:
Index.html:
<html>
<head>
<title>Jquery Test</title>
<script type="text/javascript" src="script/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$('#nav a').click(function()
{
$('#contentHolder').load('content.html #toLoad', '', function() {});
return false;
});
});
</script>
</head>
<body>
<div id="nav">
<a href="content.html">Click me!</a>
</div>
<hr />
<div id="contentHolder">
Content loaded will go here
</div>
</body>
</html>
Content.html:
<div id="toLoad">
This content is from content.html
<div id="contentDiv">
This should fade away.
</div>
<script type="text/javascript">
$('#contentDiv').fadeOut('slow', function() {} );
</script>
</div>
When the link is clicked, the content should load and the second paragraph should fade away. However it doesn't execute. If I stick a simple alert("") in the script of content.html it doesn't execute either.
However, if I do away with the #toLoad selector in the .load() call, it works fine. I am not sure why this is, as the block is clearly in the scope of the #toLoad div. I don't want to avoid using the selector, as in reality the content.html will be a full HTML page, and I'll only want a select part out of it.
Any ideas? If the script from content.html was in the .load() callback, it works fine, however I obviously don't want that logic contained within index.html.
I could possibly have the callback use .getScript() to load "content.html.js" afterwards and have the logic in there, that seems to work? I'd prefer to keep the script in content.html, if possible, so that it executes fine when loaded normally too. In fact, I might do this anyway, but I would like to know why the above doesn't work.