Preferred in jQuery, if possible, otherwise any Javascript will work.
I'd like to get the day and week number of month given a specific date or timestamp.
For example
2010-10-26 would return Tuesday and 4 as the week number
2010-11-11 would return Thursday and 2 as the week number
...
if the h2 has the word ply i want to add a break.
the titles are dynamically called, the site is html so i can't use php on anything.
heres the h2
11/400-5 4 PLY EXPERIMENTAL TIRE AIRCRAFT TIRE
want it to look like this
11/400-5 4 PLY
EXPERIMENTAL TIRE AIRCRAFT TIRE
so any title that has the word PLY in it will add a break right af...
Hello guys. I am trying to create a javascript code editor just for learning and I am doing a great job so far. The only thing is that I wanna place the autocomplete box in a position relative to the text cursor in textarea. So how can I determine the cursor position relative to the upper left corner of the window ?
Something else p...
What I want
From the above subject I want to get search=adam and page=content and message=2.
Subject:
/search=adam/page=content/message=2
What I have tried so far
(\/)+search+\=+(.*)\/
But this is not good because sometimes the subject ends with nothing and in my case there must be a /
(\/)+search+\=+(.*?)+(\/*?)
But th...
This php statement works, but is there a more readable way to express it, in terms of quotation marks.
$pCode = $row['SIZIP'];
echo " <a href='#' onClick='jfFn(\"".$pCode."\");return false;' > " . $pCode . "</a>";
...
I am looking for a quick and dirty introduction to Javascript. I program in Java and C++ on a daily basis, and I am looking for basically a three-fold "here is the syntax, here is how _ is done in Javascript, and here are important differences between Javascript and mainstream programming languages." I don't really want explanations on t...
I found a lot of examples but I'm trying to figure out the simplest way to clear an input's default value when clicking it.
This is for a search box. I have "Search for post" and I want to clear that when clicking on it.
I tried using jquery but for some reason it doesn't work.
$('#search').click(function() {
if($(this).va...
So for example I have:
http://www.example.com/index.php#/parameter1=one/parameter2=two/
Now how should I update only the parameter1's value?
...
Hi!
I am not deep in working with MongoDB. But i want to use it with C# driver. I guess that not all features can be available in this driver (Am i right?). Or for example, it easy to find some code written on javascript and, so, it seems easy to use it without mapping/finding appropriate methods in C# driver. I know that MongoDB is wri...
If the file public/javascripts/cache/all.js is removed, and then a webpage is fetched from the rails server, then that all.js file
magically reappears in the file system, with a timestamp that is half an hour ago. Is there actually Rails mechanism that regenerates this file
or what might be regenerating this file?
...
So for example:
function(input){
var testVar = input;
string = ...
string.replace(/ReGeX + testVar + ReGeX/, "replacement")
}
But this is of course not working :)
Is there any way to do this?
...
Just as the title says, does Cufon work in FBML static pages?
If not, what works to replace the fonts?
...
Hi guys!
I'm getting insane with this one...
I made a RESTful.NET webservice with C# and is running as a standalone service. When I make a XMLHttpRequest to retrieve JSON data, all browsers fail, except IE, because the status flag of the instance of XMLHttpRequest is always 0 -- it should be 200, that it's what's happening with IE.
I ...
I have two inputs, and I have attached jQuery UI Datepickers to both of them. Problem is that when I change the date on the first one, it changes on the second one and vise-versa. Suggestions?
<label for="datestart">Start Date:</label>
<input id="datestart" name="datestart" type="text">
<label for="dateend">End Date:</label>
<input id=...
function validate_request_form(){
var valid = true;
if ( document.request_form.firstname.value == "" )
{ alert ( "Please fill in first name" ); valid = false; return false; }
return valid;
}
$j('#video-request-form').submit(function() {
if (!validate_request_form() )
return false;
});
I am using this code to val...
What's the problem with this?
the hash is : #/search=hello/somethingelse/
window.location.hash.replace(/search=([^\/]*)/gi, "search=" + value);
EDIT:
I want to change just a specific part of the hash not the whole hash.
...
How to determine what is selected in the drop down? In Javascript.
...
I have an HTML table column containing integers. What's the most efficient way to get the minimum value using JavaScript or JQuery?
...
How do I express this in javascript?
9H squared plus
3H
all over 2
times L
I'm working on something like:
function calculator (height, len) {
var H = height, L = len;
total = (((9 * H)*(9 * H)) + 3*H)/2)*L;
return total;
}
calculator(15, 7);
I don't care if it's terse or not, but I'm not sure the best way to handle math in javascri...
can anyone explain what happens when you use javascript to insert a javascript based widget?
here's my js code:
var para = document.getElementsByTagName("p");
var cg = document.createElement("div");
cg.setAttribute("class", "twt");
cg.innerHTML='<a href="http://twitter.com/share" class="twitter-share-button"
data-count="vertical" data...