Tagged Questions
1
vote
2answers
12 views
Get current matching regex-rule
I try to check for a given RegExp-rule in a string and need to get the current matching rule.
Here's what I've tried so far:
var prefixes = /-webkit-|-khtml-|-moz-|-ms-|-o-/g;
var match;
var str = ...
0
votes
1answer
40 views
I'm considering placing a while loop inside a parent while loop that has the exact same conditions. Can I avoid this with a better object iteration?
I'm considering placing a while loop with the conditions (qgLLInco = 1) inside a while loop with the exact same conditions.
The idea is to exit the loop immediately, instead of appending each item ...
-1
votes
1answer
33 views
wont do FOR more than once, do the while, but the for not
this code,
for (a = 0; a < 5;a++){
var namex = document.getElementsByClassName("tooltip_sticky")[a].getAttribute("name",2);
var n=namex.split("'");
i = 0;
while(i < 30) {
...
2
votes
1answer
29 views
Javascript while loop inside .after()
Is it possible to write a while loop inside a .after() for example
$(".item-row:last").after('<tr class="item-row"><td class="description"><select name="description">' + ...
-2
votes
0answers
14 views
Fetch next 6 posts in wordpress using ajax
I am new in WordPress want to show my next 6 (custom post type) posts using ajax like on click of a button. When I click on next then it should shows next 6 and if I click on previous then it should ...
0
votes
4answers
48 views
how do i replace \ character?
i got the following code
replaceforever: function(string,find,replace){
while(_.contains(string,find)){
string.replace(find,replace);
}
return string;}
and i am sending to it something like ...
0
votes
2answers
39 views
Search array for specific value, and start over
I am getting a random generated number between one and 10 from getRandom(1,10), but i do not want the same number twice.
To prevent that, I am saving the number I get inside an array used.
Now I want ...
0
votes
1answer
42 views
letting jQuery load random src=“” values, into various <img /> tags
I want to load random built src values into 20 different img.
I'm getting a random number bewtween 1 and 20, and assign it to a name using switch.
The name is part of the src value, as well as the ...
1
vote
2answers
64 views
JavaScript Loop stuck beginner
I am trying some loops and in this specific I do not understand why is sumSoFar = 0.
This is a task from Learn Street.com
function sum(n) {
var sumSoFar = 0;
var currentNumber = 1;
while ...
0
votes
1answer
64 views
How to make/get an array from a while loop?
I don't even know if i'm using the proper terms to describe all of this, but I'm trying to use an API to make a very basic test app. That is where some of the weird words in my examples come from.
...
0
votes
1answer
85 views
For Loop in CasperJS
I'm operating a listener in CasperJS that visits a few private websites & waits for certain configurations of data. Right now, this operates adequately, but not optimally, on a numbered For loop, ...
2
votes
1answer
32 views
“Until end of touch do…” script for a web app
I am creating a web app for the iPhone and I stumbled upon a problem. So far I have only seen TouchStart, TouchEnd, TouchMove and TouchCancel. Is there any function that would combine a "loop while" ...
0
votes
1answer
65 views
Javascript While Loop Returning Strange Results
I apologize in advance if there are several things wrong with my code; I'm still very new to this.
I made a simple little RNG betting game, which follows:
var funds = 100;
var betting = true;
...
1
vote
1answer
62 views
Javascript while or for loop that changes a string until a condition is met
I am checking to see if a file exists and if so I want to do a javascript loop until the file name is okay to use.
I can't figure it out(var james is defined beforehand):
var i = 1;
while ...
-2
votes
3answers
58 views
I cannot figure out this while loop [closed]
I am having a little trouble with the code below, basically I am just practicing with loops and thought about making a little game to brush up...however I am a little stumped as to why the while loop ...