I created a function in my controller called addToPlaylist($songName). I wanted to add these song names to an array and then a session variable using an Ajax call. The first time i did this i got an error saying i do not have a template file to display in the chosen div ("add_to_playlist.ctp was missing"). I created this file and everyth...
I have a "shipping" form that I want to offer users the ability to copy their input values over to their "billing" form by simply checking a checkbox.
I've coded up a solution that works -- but, I'm sort of new to jQuery and wanted some criticism on how I went about achieving this. Is this well done -- any refactorings you'd recommend...
var check = function(){
return false;
}
var submit = document.createElement("input");
submit.type = "image";
submit.src = "submit1.gif";
submit.onclick = check;
_submitSpan.appendChild(submit);
i created a form and append a input button, but i found it can't work in IE6, when click the button, the form auto submitted. can anybody he...
Why does the "in" operator in Javascript return true when testing if "0" exists in array, even when the array doesn't appear to contain "0"?
For example, this returns true, and makes sense:
var x = [1,2];
1 in x; // true
This returns false, and makes sense:
var x = [1,2];
3 in x; // false
However this returns true, and I don't und...
I have a Raphaël text object that I would like to rotate around an axis some distance away and also rotate the text accordingly so it stays horizontal. I know this is possible using SVG transformation matrices, but the author of Raphaël has stated that they won't be a part of the toolkit anytime soon. Here's some code of what I'd like t...
I am displaying pdf on my page like this
<object data="/Customer/GetPricedMaterialPDF?projID=<%= ViewData["ProjectID"]%>"
type="application/pdf" width="960" height="900" style="margin-top: -33px;">
<p>
It appears you don't have a PDF plugin for this browser. No biggie... you can <a
href="/Customer/GetPricedMa...
A web application I'm helping to develop is faced with a well-known problem: we want to be able to let users know of various events and so forth that can occur at any time, essentially at random, and update their view accordingly. Essentially, we need to allow the server to push requests to individual clients, as opposed to the client as...
I have two links that should open up thickbox's in iframes but only one works (the one with the id of product_photo_zoom_url2). I have the following jquery code that works when this code (in first code box) s removed from the markup. This code loads a picture zoom function. See complete markup below. All that happens when the first zoom ...
Hello,
I have a page where dynamic content arranges vertically one below the other.
Content is small boxes & I want to arrange them horizontally next to each other.
How can I achieve this ?
Thanks.
...
I have a page when, if the user is near the bottom of the page, loads the next page.
I just recently switched it to jQuery, and now use the jQuery.ajax() function to get the data. However, now i cannot check if the xhr is already loading, making the page load multiple xhrs when the user near the bottom.
My listener is:
$(document).scr...
Hi everyone,
I wanted to ask if there is a way to capture the print events (like IE onbeforeprint and onafterprint events). Actually I would like to do more. I want to know if I could interrupt printing, cancel it or may be change the print option all together to have a myPrint option.
Can this be achieved through plug-ins...
Consider the following code:
var Widget = new Class({
Implements: [Options],
options: {
"name" : "BaseWidget"
},
initialize: function(options) {
alert("Options are: " + JSON.stringify(options)); //alerts "Options are: undefined"
this.setOptions(options);
alert("My optio...
There are a lot of questions here about Greasemonkey, but I didn't see anything directly related to my question.
I'm on a website that uses a text editor control, and it's really annoying that they don't allow horizontal resizing (only vertical). So if you are using a cheapo projector that only supports 1024x768, the text runs off of t...
Hi,
i have this show/hide menu.
It is possibly this menu make with memory?( I open sub menu, refresh page and this sub menu stil open. )
<script type="text/javascript">
function change(id){
ID = document.getElementById(id);
if(ID.style.display == "")
ID.style.display = "none";
else
ID.style.display =...
What is the JavaScript equivalent to the following PHP code:
$expTime = time() + (5 * 60 * 60); // now plus 5 hours (5 hour; 60 mins; 60 secs)
$expTimeStr = gmdate('Y-m-d\TH:i:s\Z', $expTime);
...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
</head>
<body>
<div id="test">
</div>
<script type="text/javas...
This question of mine (currently unanswered), drove me toward finding a better solution to what I'm attempting.
My requirements:
Chunks of code which can be arbitrarily added into a document, without an id:
<div class="thing">
<elements... />
</div>
The objects are scanned for and found by an external script:
var things = yd.ge...
Hi,
I want to write a function in javascript which creates a file and write some content to it, iam working with firefox, can anybody help me in this case.
Thanks...
...
Hi All.
I can't find great way to debug javascript. I know firebug on firefox, but it's not best way I think. I want to put break point and trace program but I can't with it.
Do you know good tool or how to trace the program.
...
I have a classifieds website, and on each classified there is a tip-form where users may tip a friend about the classified.
The tip-forms' action is set to a php-page, which mails the email after sanitizing etc...
I have to filter away spam etc so that my email-server don't get blacklisted or anything...
I have my own server (VPS, Linu...