|
Member 14807823 wrote: as if commented out part worked. What happens when you uncomment it?
|
|
|
|
|
Hi Richard,
The commented part was to illustrate what I was trying to do, it wont work.
so it wont go to the indexfr.html page
Thanks
Peter
|
|
|
|
|
I think your syntax is not correct, try this:
var cc = geoplugin_countryCode();
if (cc == 'FR'|| cc =='CH' || cc =='LU' || cc =='BE' || cc =='LI'){
location.href = "indexfr.html";
}
|
|
|
|
|
Hi Richard,
Yes it was the syntax,
that was the neat and correct solution
Thanks
Peter
|
|
|
|
|
Yes, and I should have spotted it the first time. I will try harder in future.
|
|
|
|
|
It looks like all you need to do is debug it. I'm not sure what you were wanting us to do.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Hi Richard
Mainly I wantad to know if that should work, looking around is seems not to be correct..
I dont know how to debug it.
thanks
Peter
|
|
|
|
|
Member 14807823 wrote: I dont know how to debug it. That is the most important skill to have when writing code.
Basically, press F12 in your browser and your browser's developer tools will open. First, check the console to see if you have errors. Then you can click in the line of code you want to test and create a breakpoint.
Too much to go into here, but yes, you'll want to learn to debug.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Hi ZuroDev,
Yes I know
thanks
Peter
|
|
|
|
|
for what this script? can use in website streaming?
|
|
|
|
|
I'm just getting started and learning through a book and this code won't run on google, was wondering why and what I needed to do to fix it. Thank you in advance.
<pre>
function zeroPad(number, width) {
let string = String(number);
while (string.length < width){
string = "0" + string;
}
return string;
}
function printFarmInventory(cows, chickens, pigs) {
console.log(`${zeroPad(cows, 3)} Cows`);
console.log(`${zeroPad(chickens, 3)} Chickens`);
console.log(`${zeroPad([pigs], 3)} Pigs`);
}
printFarmInventory(7, 16, 3);
|
|
|
|
|
Hi JaHowler,
Maybe you can try this.
function zeroPads(animal, width){
let strNumber = animal.toString(),
len = strNumber.length;
while(len < width){
strNumber += `0${strNumber}`;
len++;
}
return strNumber;
}
function printFarmInventory(cows, chickens, pigs){
console.log(`${zeroPads(cows,3)} Cows`);
console.log(`${zeroPads(chickens, 3)} Chickens`);
console.log(`${zeroPads(pigs, 3)} Pigs`);
}
printFarmInventory(7,16,3);
Output:
"7070707 Cows"
"16016 Chickens"
"3030303 Pigs"
Hope this helps. Thanks.
Cheers,
Jin
|
|
|
|
|
Thank you, I appreciate your time and help
|
|
|
|
|
That code works fine for me in Firefox and Chrome. Which browser are you using, and what errors are you getting?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have a Windows alert, after I click ok I want to chain the asychronous methods as synchronous. Not sure how?
alert('test')
.then(() => {
})
.then(() => {
})
.then(() => {
})
.then(() => {
});
I thought about using promise in JavaScript, but not clue so far.
|
|
|
|
|
alert pauses your code until the user clicks "OK", so there's no need for a promise.
NB: Since you've dropped support for Internet Explorer (which doesn't support arrow functions[^]) you might as well use an async function[^]. That will make your code easier to read.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
how can I use it what is it and how can I start hacking easily
|
|
|
|
|
|
var map = new ol.Map({
renderer: 'canvas',
target: 'map',
layers: [layer],
view: view
});
var vectorLayer = new ol.layer.Vector({
source:new ol.source.Vector({
features: [new ol.Feature({
geometry: new ol.geom.Point(ol.proj.transform([-0.12755, 51.507222], 'EPSG:4326', 'EPSG:3857')),
})]
})
|
|
|
|
|
Is that a statement or a question?
|
|
|
|
|
|
Well it needs a lot more detail. It is far from clear what you are asking.
|
|
|
|
|
Is there any way to use map offline with web application.
|
|
|
|
|
What do you mean 'offline'? StreetMap, Google maps etc., are all web based.
|
|
|
|
|
offline mean I Can Access it without Internet also.
|
|
|
|