Hey all,
I was wondering how you all organize your random functions to improve a language's functionality outside of OOP classes (global functions). I've seen libraries, but I'm still not sold on this being a good solution, especially if you don't have enough functions. I'm specifically interested in how people organize random PHP and ...
EDIT: I'm not sure that my original question is clear enough. I need an algorithm that will compute the minimal sequence of moves to rearrange an array from one order to another. It is known that both arrays will contain the same elements (no duplicates) and have the same length. For example:
reorder(
['d', 'a', 'c', 'b', 'e'],
[...
Hi there!I guess I need help on this one.I'm not new to Javascript but then I realize I don't know how to use setTimeout().
I have tried this:
$(document).ready(function(){
setTimeout('changeit()',1000); // I have also tried setTimeout('changeit',1000);
// var t = setTimeout('changeit()',1000); <--- tried also something like this....
Can you have two counts with for loop?
Example:
for( var count1 = 0, count2 = 0; count1 < 5; count1++, count2++ ) { }
If not, what would be a good way to handle two separate counts other than using two loops?
...
I have a dijit.form.Select widget. It's tied to a data store, if that matters. It's filled with several options already. All I want to do is programmatically set its value. I can get its value using myWidget.attr('value') but if I try to do myWidget.attr('value', 5) for example (where 5 is one of the valid values), all it does is reset t...
We have an intra-net website that requires me to enter login information every time and it's annoying.
I want to create some sort of automatic login for this website.
I tried creating a two-frame website, with one page being the login page and the other being my own html. In my html, I wanted to enter values to the textboxes in the othe...
<img src='<%# "ThumbNailImage.ashx?ImID="+ Eval("ImageID") %>' id="ImgShow" runat="server"
align="top" style="border: solid 1px Gray;" height="150"
width="170" onclick="javascript:myFunction();" >
protected void gvImages_SelectedIndexCha...
I really like the way Reddit's comment system works - particulary the ability to smoothly fold/unfold a tree of comments.
Is there some standard JavaScript code/library that does this? Or did Reddit develop this inhouse and is not portable?
I'm fairly a beginner in JS, so browsing through Reddit's page source is not that helpful.
...
All,
How to make the div more presentable in the below code.
i.e, on mouseover the div should look like as same as title attribute or even better
And the text on it should also look presentable
<style type="text/css">
#div1 { width: 200px; height: 30px; background-color: #a9a9a9; color: #fff; position: absolute; }
</style>
<script sr...
Hi.
I have worked on a script, that will makes so when you click on a text it changes to a input field and a submit buttom. In the input field you can change the text, and the submit button to "apply" the new changes.
Now i cant get it to work, when you press the submit button. When you click the submit button it just changes the input f...
So I'm trying to debug my website... basically what I need to do is write a script that will periodically follow a link on my page, but I need to see the result in my browser which is why I need it to happen in the browser. I want it to click on the same link every few seconds without any human interaction.
The resulting page each time w...
I'm getting this message in error console:
Error: uncaught exception: [Exception... "Cannot modify properties of a WrappedNative"
nsresult: "0x80570034 (NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN)" location: "JS frame ::
chrome://global/content/bindings/autocomplete.xml :: onxblpopuphiding :: line 834" data: no]
I checked everything I'v...
erm...can jquery toggle the original css(style.css) value and the new value(set in the .animation{})?
$(function() {
$('a.maximize').click(function() {
$($(this).attr('href')).animate({
position: "absolute",
top: 0,
left: 0,
height: '99.5%',
width: '99.5%',
opacity: 1,
},1000...
With the help of JavaScript, of course.
...
Hi my problem is a bit wired:
my $.ajax success handler looks like:
function(data){
alert(data);
}
Pretty simple, yeah?
The problem is that data IS ALWAYS 3 character long - no matter what was sent by the server! The characters: 31 65535 8 (using charCodeAt()).
In other browsers (even in IE 8) all works fine.
I've looke...
Hi, I want to scrape data from www.marktplaats.nl . I want to analyze the scraped description, price, date and views in Excel/Access.
I tried to scrape data with Ruby (nokogiri, scrapi) but nothing worked. (on other sites it worked well) The main problem is that for example selectorgadget and the add-on firebug (Firefox) don’t find any ...
Is there a better way to write this procedure that completes a relative url for my website?
if (!url.startsWith('http')) {
url = + location.protocol + '//' + location.host + (url.startsWith('/') ? '' : '/') + url
});
...
I find myself working on an application that started out small but that has increasing amounts of javascript in it.
Currently my code is procedural. However the codebase is growing in complexity and I suspect I am getting into a situation where a more object oriented approach would be appropriate.
I come from a procedural background...
This is xml code and I want to write code with javascript using DOM to get the father, mother, daughter and son names ------->(ali,mona,ghada and mohamed)
Can any one help me?
<family>
<grandfather>Ibrahim
<father job="Engineer">Ali
<mother>mona</mother>
<daughter age="23" job="ITI stud...
will it get "laggy" if i fetch 1 million link elements and put it in the DOM.
cause i want a navigation list on top..its kinda like the one Apple's got on their site and you can scroll left or right with your keyboard. the only difference is that the center image will be get larger in size compared to the others.
the link elements will...