I'm relatively new to using oop in Javascript, and I'm wondering what the best practice is for private methods. Right now, I'm using mootools to create my classes and I'm simulating private methods by prefixing them with an underscore and forcing myself not to call the method outside of the class. So my class looks like:
var Notifier ...
Hi
I wanna check all request calls from browser...Is there any solution in Javascript
...
Hey,
So I've got my javascript array (var seatsArray = [];), let's say it has some contents. I want to write the contents of that array to a .txt file on the server when the user clicks a button. The text file will not already exist so it needs to be created.
Also, if anyone knows how I could allow the user to specify the name of the t...
hi
I have one user control to pick the date which utilizes ajax calendar extender. Also it has javascript validation for checking date format. Control is working fine when its visibility is true in loading time. But giving javascript error if i am making it visible with a button (server control) click.
Below is the javascript functio...
I have a page that uses Ryan Bates nested_form plugin. The plugin is used when you have form based on one model and then additional fields that belong to another model. For example if I had a form that created categories, and at the same time I wanted to add items to the new category, my form would contain input fields for the category m...
I use this code http://www.openjs.com/scripts/events/keyboard_shortcuts/index.php for handling keyboard shortcuts.
shortcut.add("Ctrl+Z",function() {
setTimeout(function() {
var val= $("textarea").val();
var length = val.split("\n").length;
alert(length);
}, 100);
},{
'type':'keydown',
'propagate':true,
'...
Hi, I am trying to set a marker on my Google map. I think I do it like Google wants me to, however the marker does not show up on the map. What am I doing wrong? You can see the implemented map here: http://nidarosnaprapati.no/wordpress/?page_id=66
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatL...
I am working a project currently in which the user can add multiple news headlines and news articles, the number they add is entirely up to the user, for this reason the form they first see only has room for 1 headline and 1 article, to add another article/headline there is a 'button' that has a click event on it, currently I have this i...
Why does this error happen? I didn't do anything to that file?
my links that call javascript are within a from... that shouldn't be a problem though.. right?
The offending code block:
getElements: function(form) {
return $A($(form).getElementsByTagName('*')).inject([],
function(elements, child) {
if (Form.E...
I'm using a DIV as a simple DHTML graphical button on a webpage. It contains no text, and a background image provides the button's appearance. This works perfectly in Firefox and Chrome, but in IE, when the button is clicked a blinking vertical text cursor shows up, presumably where the text line would start. How do I disable this?
I've...
I have dates and description. If the date is entered, then the description should autocomplete. Like if 12/25/yyyy is selected, then Christmas should automatically be shown?
I tried this, but its not working. Any help?
`
$(function() {
$('#date').datepicker();
});
$(function() {
var availableTags = ["Christmas Day","etc"];
$("...
Exists any JavaScript or Objective-C method to convert a location.href="MyURL" to <a href="MyURL"></a>??
I have over 200 location.href URL not working with UIWebViewNavigationTypeLinkClicked :-S
Thanks to everyone can help me!
...
I have one textbox and two checkboxes with a submit button. I want to put a customvalidator which shall call a javascript for the following condition -
If textbox.value > 0 then checkbox1 = checked or checkbox2 = checked. If neither checkboxes checked when textbox.value > 0 then raise error.
any ideas?
...
i am getting date in the format (YY/DD/MM) for ex 2010/12/07
i want to change format to Monday 7 July, 2010 through javascript
...
So I want to call a javascript function when I click on a telerik control.
<telerik:RadDatePicker Width="110" ID="rdpFromDate" runat="server" AutoPostBack="false" OnSelectedDateChanged="JSFunction();">
Can anyone tell me where I'm going wrong?
...
I have a JSON object that I want to sort by one key first, then by a second key similar to ordering by two columns in SQL. Here is a sample of the JSON I would have:
{
"GROUPID":3169675,
"LASTNAME":"Chantry"
}
I would like to order all the results by the GROUPID and then by LASTNAME. I've used the JSON sort function to sort by one ke...
I'm creating a web app for the iPad and I'm trying to assign a touch event to an element within canvas. I have it set up like this:
function initialize() {
touch_element = new Image();
touch_element.src = 'img/image.png'
touch_element.onload = function(){
canvas.drawImage(football, 50, 50, 184, 120);
touch_e...
I have a thumbnail image that when you click it changes a larger image on the page. So far I have the Javascript figured out for passing on the .src, .alt, and .title information that makes the picture and tool tip of the picture change.
The large picture has a caption underneath. I was wondering how to also have the caption change ...
I'm trying to work with mytablegrid.
There is a working example here
On the bottom of the grid, there is a small subtable called the "pager" which allows the user to navigate between pages.
The html is like this :
<a class="mtgPagerCtrl" id="mtgFirst1">
<img height="16" width="16" border="0" mtgfirstpage="" class="" src="../images...
I'm working on a safari extension and I was wondering if there is a way to do synchronous message passing in a safari extension.
I want to send a message from my injected javascript to the global page have the injected javascript wait until a result is returned. Having to split my code into another function that receives a message from ...