The sample string:
this!is.an?example
I want to match: this is an example.
I tried this:
<script type="text/javascript">
var string="this!is.an?example";
var pattern=/^\W/g;
alert(string.match(pattern));
</script>
...
Hello,
I just got around to installing mod_deflate on my server. I also added the following to my Website Optimizer in cPanel:
text/html text/plain text/xml text/css text/js text/javascript
Now, the site shows considerable improvement in loading time (almost 3x!), but ySlow is still giving me an "E" rating for "Compress Components wit...
I was looking into google.com's Net activity in firebug just because I was curious and noticed a request was returning "204 No Content."
It turns out that a 204 No Content "is primarily intended to allow input for actions to take place without causing a change to the user agent's active document view, although any new or updated metainf...
the code below is a jquery POST request javascript.
i want to use the data I am posting in the callback function. if u take a look,
$('#fb_user_msg').innerHTML = data.comment;
the above line is trying to include the comment in the html (unsuccessfully). i am sure this is easy but I dont know why I am not getting it right.
$("#submit...
The host that the majority of my script's users are on forces an text ad at the end of every page. This code is sneaking into my script's AJAX responses. It's an HTML comment, followed by a link to their signup page. How can I strip this comment and link from the end of my AJAX responses?
...
Trying hard to replace the eval without using Function constructor. Stumped. I am not a newbie but not an expert either.
jslint says this is evil; when I replaced it with a Function constructor, it said that was just a form of eval()!
evaluateEventScript: function(requestObject) {
var resultData;
resultData = eval(r...
I'm trying to get the name of an element in Javascript. Meaning if the element is <div />, then "div" would be returned. If it's <img src="" /> then "img" would be returned. I'm using jquery to select a bunch of elements and then calling a custom function on all of them. Within that function I want to know what I'm dealing with. How do I...
I have an array of arrays. The inner array is 16 slots, each with a number, 0..15. A simple permutation.
I want to check if any of the arrays contained in the outer array, have the same values as
a test array (a permutation of 16 values).
I can do this easily by something like so:
var containsArray = function (outer, inner) {
...
Hi! I am in trouble!
I have a page called results.php that has a hidden iframe and a DIV container. When the page is loaded, some code is run in the hidden iframe which, when complete, loads the results into the CONTENT DIV in the results page, generating a scrollbar to results.php
All this works fine, but when I have anchors in the c...
i have a html table where one of the columns is a set of checkboxes
There are three checkboxes in each row. The original names of the checkboxes are
Row 1: person[0].Choices (value=1 name= person[0].Choices value=2 person[0].Choices, etc. .)
Row 2: person[1].Choices(value=1 name= person[1].Choices value=2 person[1].Choices, etc . ...
I found an anchor plugin for jQuery, and its demo site is at http://www.position-relative.net/creation/anchor/.
I am developing a FAQ page on a website where a list of questions are followed by a list of answers. I could use the scroll effect to move down to the corresponding answer when a user click a question. But I also want the answ...
I have a DIV with some characters. How can I remove the last character from the text with each click on the DIV itself?
...
Hi All,
I'm trying to edit the readability.js file from http://code.google.com/p/arc90labs-readability/.
It's a bookmarklet that "cleans" the current page by stripping everything except for the web page/web article title and body.
However, I'd like to edit the script so that when the bookmarklet is active, the current page is untou...
I am using gwt with google maps api and i have a set of tabbed infowindows. in one of them i want to have a recent tweets script running. it works fine in firefox, but it comes up as blank in ie and chrome. heres the HTML that im putting in the tab:
HTML recentTweets = new HTML(
"<body>"+
"<div style='...
hi
I want to customise google check out page . Ie , I want to place my logo in google check out page that will appear when i clicked google check out button in my site this is the place order page . Is it possible to customize the google check out place order page ?
...
I am using iframe with design mode on like textbox (The Richtextarea Concept) and which changes i am making in iframe that will affect in the div. but there will be only text changes no Image.
How to do this Because the changes will be done in this iframe only but can not be seen to user.
...
Hi
I have implemented a tiny msc in my project . I want one text editor and one text area , But all the text area in my page appears as a text editor , How i avoid this problem , Below is my code ..
<script type="text/javascript" src="./js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General opt...
I am filling DropDown dynamically using AJAX. The DropDown code looks like this:
<select class="element select medium" id="inDistrict" name="inDistrict" onclick="MakeRequest('divDistrict', 'inDistrict', 'SELECT * FROM districtmaster');" onchange="alert(document.getElementByID('inDistrict').value);">
<option value="Select" selected=...
i got a null object when i try to fetch an element by id using prototype's $ function, and got this strange behaviour:
document.observe('dom:loaded', function() {
$$('.answer').each(function(answer) {
console.log('answer.id: ' + answer.id);
console.log('$(answer.id): ' + $(answer.id)); # works, so the element does exists
c...
Using CSS style Sheet
I have the button images, I want to add a button images in to my web page menus
For Example
Home Contact
->Aboutus -> Location
Home, Contact (menu)
Aboutus, Location(sub menu)
Button images name - button1.jpg
I want to add a my button image in the background of menus and sub menus
am new...