Are there any good JavaScript libraries that can do this ?
These are usually done in flash
I have found this plugin so far, looking for others to evaluate.
http://jquery.vostrel.cz/reel
Textarea validation ,
How to limit the characters in a textarea for not exceeding emore than 50 characters.
<textarea rows="5" cols="15"></textarea>
Thanks.....
Hi All,
I am using fedora/mozilla for my development enviorment.
I am using
margin: 0 auto;
to align a content in a center but it's not working on windows/IE8. while it is working properly on All other browser for Fedora, Window, Mac.
Regards,
Salil Gaikwad
Hi all
I've got a problem about onbeforeunload recently that I need to pop up a voting page if the user try closes their IE browser.And I did it by using
<body onbeforeunload="makevote()">
And the main structure of makevote() in javascript as follows:
function makevote()
{
comet.distruct();
if(csid != null && isvote == null)
{
window.event.returnValue = false
window.event.returnValue='press “cancel” to vote please!'
showComDiv(popvote,"popiframe",400,120,'your vote here','dovote()');
}
}
For last three months this voting function performed so ugly that I got only less than 8,000 votes from more than 4,50,000 vistors.I think the problem is, when the users try to close their browsers,the onbeforeunload property pops up a comfirm box which covered my voting box while most users click the OK button,which means close comfirming is done,as a habit.So my question is how can I control the comfirming box made by onbeforeunload myself? So far I can only define the message it shows.For example if I click the "OK" ,I'll go to the voting box instead of closing my IE.And if there's any other better way to do this?Help would be greatly appreciated!
Regards
Hi
I have a problem with flash in Chrome.
I have a couple of mailto: links in my flash web page, when clicking on them in chrome they either don't do anything at all, opens up a blank page/tab and no email client or opens an email client once (have to refresh the page in order to click it again).
Does anyone know the best way in which to do a chrome supported mailto? Seems to work in all other browsers.
I have changed the target to _blank, _parent, _self etc. Plus I have one link actually on the stage and another running through AS.
Hope that makes sense, cheers.
Hi, I want to get a thumbnail image for videos from Vimeo.
When getting images from Youtube I just do like this:
http://img.youtube.com/vi/HwP5NG-3e8I/2.jpg
Any idea how to do for Vimeo?
Here is same question, without any answer.
Hey,
I have an input text :
<input name="Email" type="text" id="Email" value="[email protected]" />
I want to put a default value like "What's your programming question ? be specific." in StackOverFlow, and when the user click on it the default value disapear.
Hello,
For the form below, how could I make the input field big, like maybe 100 pixels in height by 400 pixels in length?
Thanks in advance,
John
<form action="http://www...com/sandbox/comments/comments2.php" method="post">
<input type="hidden" value="'.$_SESSION['loginid'].'" name="uid">
<div class="addacomment"><label for="title">Add a comment:</label></div>
<div class="submissionfield"><input name="title" type="title" id="title" maxlength="1000"></div>
<div class="submissionbutton"><input name="submit" type="submit" value="Submit"></div>
</form>
Hi. I'm seeing in another forum if the best way to do this is with Javascript or Ajax but I'm wondering if there is an even easier simpler way. I'm trying to create a web service where users can check which countries they have visited from a list of 175 or so and a World map image would then instantly update with a filled color.
There are other similar services, but I'm envisioning mine to be both updating from checks in checkboxes and by clicking on the target country in the displayed image say with an imagemap. Additionally other solutions display all the visited countries in the same color. I would like different colors for different countries or at least for those countries that touch. Eventually I would like to include a feature that enables the choice of which colors to assign countries.
I found a Sourceforge project called pwmfccd. It's simply an open source image of the world and the coordinates on the PNG image for all the countries. You can use mogrify from ImageMagick and floodfill to fill the countries with color. I have done this successfully, locally with batch files.
My ISP has told me where mogrify is located, basically "/usr/bin/mogrify". I now have a horrendously complicated cgi script which if it worked is set to redraw the world map image with each checkbox. It's here. It also redraws the whole web page with each check. The web page starts here. Of course this is not at all efficient, and I think probably the real way to go is Ajax or Javascript, so that maybe just the image gets changed and redrawn, not the whole web page. Sorry I don't even know the difference between Javascript and Ajax and their relative merits at this point.
I suppose you could make just one part of the image update with each check or click on the image instead of even just the image redrawing, but I have never even heard of a hint at being able to do that for irregularly shaped image elements like countries. So I guess an Image map and sister checkbox entries tied to mogrify events redrawing the user's personal copy of the image with an image refresh would be the only way to go.
So how do you do this with something other than Javascript or Ajax or is that definitely the way to go and if so, how would you do it? Or can you after all cut up a web based image into irregular puzzle shaped piece which you can redraw individually at will.
Thanks in advance for reading and considering answering this post.
Hello,
From a MySQL table called "submission" containing the fields "loginid, submissionid, title, url, datesubmitted, displayurl", I would like to print an HTML table thats contains all "title" and corresponding "datesubmitted" where "loginid" equals "$profile." The code I am trying to use is below. It isn't working. Any ideas why it isn't working?
Thanks in advance,
John
$profile = $_GET['profile'];
$sqlStr = "SELECT loginid, submissionid, title, url, datesubmitted, displayurl
FROM submission
WHERE loginid = $profile
ORDER BY datesubmitted DESC";
$result = mysql_query($sqlStr);
$arr = array();
echo "<table class=\"samplesrec\">";
while ($row = mysql_fetch_array($result)) {
echo '<tr>';
echo '<td class="sitename1"><a href="http://www.'.$row["url"].'">'.$row["title"].'</a></td>';
echo '</tr>';
echo '<tr>';
echo '<td class="sitename2">'.$row["datesubmitted"].'</a></td>';
echo '</tr>';
}
echo "</table>";
So the function nl2br is handy. Except in my web app, I want to do the opposite, interpret line breaks as new lines, since they will be echoed into a pre-filled form.
str_replace can take <br /> and replace it with whatever I want, but if I put in \n, it echoes literally a backslash and an n. It only works if I put a literal line break in the middle of my script, and break the indentation (so there are no trailing space).
See:
<?=str_replace('<br />','
',$foo)?>
Am I missing escape characters? I think I tried every combination...
When I have to render textarea content to the front end I usually pass it thru a function that converts newlines to <br/> tags and double newlines signal paragraph tags so blocks of text get surrounded by <p> and </p> tags.
To save time I usually use a ready made PHP function from the wordpress codebase. You can get the link from the man himself:
http://ma.tt/scripts/autop/
If you check it out you'll see it does some heavy lifting with about 20 regular expressions.
I know I could use a wysiwyg editor (like TinyMCE or CKEditor) that can format the data on the client and then send it to the server (most of them add <p>..</p> tags by default) but I want to know the experience of others in handling raw textarea input and then displaying it on the front end.
I`m in the process of building a template for Redmine (a project management system based on Ruby on Rails.)
Ruby is running on a virtual server from a Bitnami.org installation package. The OS is Windows.
The template essentially consists of a styles.css file. In that file, I have the following line:
#header { padding: 0px; padding-top: 48px; background-color: #62DFFF;
background-image: url(../images/bkg.jpg);
background-position: center bottom;
background-repeat: repeat-x;
height:150px; }
It's a header element with a background image.
The problem: This background image arbitrarily appears and disappears when reloading the page. It is more often missing than it is not. Say you reload the page in your browser ten times in twenty seconds; the image will appear in two instances, and be missing in the 18 others.
I would have put this down to server problems, but the weird thing is that when it's missing, the request for the image doesn't appear in Firebug's net tab at all. Even if it were cached, the request should be there, shouldn't it? Raw screenshots of the identical page on two reloads:
I am 100% sure the CSS file does not change in between. I have examined both instances with Firebug and the CSS is identical.
When I change the image's URL by editing the style declaration in firebug to bkg.jpg?xyz=123445 then the image will get loaded, which is making me think this must be a server problem.
It happens in both Firefox and Chrome so it must be something basic I'm overlooking.
What could be causing a browser not to load a resource at all?
I have zero idea about Ruby nor Rails - getting Redmine running and customized is all I have ever had to do with this platform - so I don't really know where to start debugging. Apache's, Mongrel's and Redmine's error logs look fine, though. And then again, this looks like a browser issue. I'm stumped.
This is a little difficult to describe, but basically there is undesired space left by a floated div on my page. Here are pictures describing the problem. The black boxes are divs.
Before floating:
After floating:
Desired effect:
And I'm not sure if it makes a difference, but I also have an empty div with "clear: both" placed immediately after the floated div.
How can I achieve this?
Is there a way to shrink what's inside an iframe without adjusting css?
any magical 'zoom' parameter out there?!!!
I have a 600px preview iframe i want to fit a 1000px site in without scrollbars...
I have a web page which allows the user to carry out various operations that in turn modify the database. Also, this web application needs to keep track of various fields in database that keep changing with time. Is refreshing the page every few seconds the best possible way to implement this? For example, if there is a long list on the page requiring scrolling, it is hard to view the list since the page keeps resetting due to the refresh. I know, there are ways to retain the position of the scroll. But, could I use something more efficient?
I am working on a site maintainence. It uses mod_rewrite technique. But im new to mod_rewrite. How should i change the url to work correctly in my localhost.
here's the code:
# Enable mod_rewrite, start rewrite engine
Options +FollowSymLinks
RewriteEngine on
rewritecond %{http_host} ^electricians4u.com.au [nc]
rewriterule ^(.*)$ http://www.electricians4u.com.au/$1 [r=301,nc]
ErrorDocument 404 /error404.php
# for searching
RewriteRule ^([^/]*)-in-([^/]*)\.htm$ /search.php?searchby=$1&SearchString=$2&search.x=$3&search.y=$4&search=Find+Agent [NC]
# for nav
RewriteRule ^electricians-in-([^/]*)-([^/]*)$ /search.php?SearchString=$1&state=&page=$2 [NC]
# index page
RewriteRule ^find-electrician-(.*)$ /find_electrician_in.php?state=$1 [NC,L]
# find page
RewriteRule ^electrician-(.*)-(.*)$ /find_electrician_in.php?state=$1&bspname=$2 [NC,L]
# find page
RewriteRule ^electricians-in-([^/]*)\.htm$ /search.php?state=$1&bspname=$2&locality=$3 [NC]
Plz help. I know this silly question to ask. But i dont know other alternative.
hi
I'd like to integrate a theme tag to my elements so they appear in diffrent colours. But since the css selectors have the same css specificity the latest overrides the earlier defined rule.
this is an example that shows my problem:
....
<div class="red">
<div class="box">This should be red</div>
<div class="yellow">
...
<div class="box">This should be yellow (nested in x levels under the div.yellow)</div>
...
</div>
....
and here my css
.box { width: 100px; height: 100px; }
.yellow { background-color: yellow; }
.red { background-color: red; }
the box should be listed somewhere, but as soon as it is a sub child of another color definition it should been overwritten.
thanks for any help!
//jim
I have a jQuery colorbox opened over top of my webpage (with a <select> drop down list) and I'd like to make an AJAX call every time a new <option> is selected from the drop down.
I have the following code, but it's not picking up the select event.
$('#cboxLoadedContent select[name=parent]').live('select', function() {
$.get("edit.php", { fn: 'getFormatLevel', parent: $('select[name=parent]').val() }, function(data) {
alert("Data Loaded: " + data);
});
});
Any ideas why this isn't even recognizing my selector?
I want to display about 5-8 images on my page, one by one, but I would like them to pre-load one and not loading them each time i switch to anohter image.
I have seen some examples where they have all images (hidden) on the page something like:
<a href=""><img id="img1" src="images/image1.png" class="image" alt="" /></a>
<a href=""><img id="img2" src="images/image1.png" class="image" alt="" /></a>
<a href=""><img id="img3" src="images/image1.png" class="image" alt="" /></a>
And the unhide the current image.
And what I have is one image that i change it's src attribute for path for new images from th array.
SwitchNextImage: function(){
var theimg=document.getElementById("imgContainer");
this.currentIndex = this.currentIndex+ 1 == this.totalImageCount ? 0 : this.currentIndex + 1;
theimg.src=this.slideimages[this.currentIndex].src;
}
The first method is obviously faster loading. But requies static links.
My questions is how can I make my method more faster loading?
I have to choose an online WYSIWYG editor. I'm pending between TinyMCE and Xinha. My application is developed in Asp.Net 3.5. Could you help me with with some pros and cons?
I was looking at this question: http://stackoverflow.com/questions/117641/how-to-remove-duplicate-elements-from-an-xml-file
It has <ns0: for ? I have never seen it before.
My form looks like:
**
<p><label>first name</label><input type=text name=fn /></p>
<p><label>last name</label><input type=text name=ln /></p>
</div>
<div id="rightform">
<p><label>state</label><input type=text name=state /></p>
<p><label>city</label><input type=text name=city /></p>
</div>
**
I want the layout so all the labels line up on the left (with the label text right-aligned), and the input box all lined up, floating to the left.
So the form should look like:
asdf-label INPUTBOX
123-label INPUTBOX
yet-another-label INPUTBOX
There will be another form on the right side of the above form (with the id=#rightform)
Really confused how to do this properly...