|
I am looking for a method to close the current tab of the browser window using JavaScript.
|
|
|
|
|
Unfortunately you can't for security purposes. You can only close windows that were opened by Javascript.
|
|
|
|
|
|
Member 14713926 wrote: window.close(); If you know about this, why are you asking then?
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.
|
|
|
|
|
Because it's an excuse to post a link to his spam "best programming tutorials" site.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: "best programming tutorials" I could use some of that.
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.
|
|
|
|
|
In earlier times you got the full client path from a file upload and we were running ActiveX on our web pages. What's your point?
|
|
|
|
|
That is why websites were easily hacked in the earlier times due to inefficient security.
Like I said, javascript can only close windows that was opened by it.
|
|
|
|
|
Please see attached screenshot. I have question with two options. If user select option 1 then I would like to redirect to URL1 and if user select option 2 then I would like to redirect to URL2.
How can I do that?
JSON code is here. I am using HTML to show the question.
[
{
"question_code": "Q1",
"type": "radio",
"question": "Question1",
"required": "true",
"options": [
{
"code": "Q1OP1",
"text": "Option1",
"child": [ ],
"steps": 11
},
{
"text": "Option2",
"code": "Q1OP2",
"child": [ ],
}
}
]
|
|
|
|
|
|
Guys Please help me , How do I link this HTML with Css and Js properly?
https://codepen.io/gcarino/pen/LDgtn[^]
This is very short coding can someone please do this linking for me ?
I tried copying all codes in separate notepads and saved them as Css . Js and then I opened up HTML coding and linked my case and jss files and saved it .html but when I opened up website there's only blue box with " Learning J's " and a next button
And there are not any questions
Can someone please help me ??
|
|
|
|
|
I am making a live subway map, where I have divs representing trains, moving up and down the map.
I had no problem making them move, but I would like them to stop for a few seconds at each station.
Can someone tell me how I can include this in my code?
What line do I need to add, and where?
window.onload = () => {
startSetTimeoutAnimation();
};
function startSetTimeoutAnimation() {
const refreshRate = 1000 / 60;
const maxXPosition = 400;
let rect = document.getElementById('rect0');
let speedX = 0.01;
let positionX = 25;
window.setInterval(() => {
positionX = positionX + speedX;
if (positionX > maxXPosition || positionX < 25) {
speedX = speedX * (-1);
}
rect.style.top = positionX + 'px';
}, refreshRate);
}
|
|
|
|
|
images in are loading properly when I am running the application locally but even though images are appearing in the folder on Server but not being loaded in the Sources when I see them, in the same folder structure when ran locally they are being loaded - any help why would that happen? When even the folder contains the images - any help please - thank you.
|
|
|
|
|
You should know by now that we cannot guess what your code is doing. Please edit your question and show the proper details of the problem, including the code that is trying to load the images, and the actual path where they are stored.
|
|
|
|
|
Yeah I know but here is my problem.
Its an Ember Code and it will be converted into a big app.js file - before that all those files and everything would be converted - I am not sure how can I show you the code -Ember Code before conversion into js or after js conversion. I think Web-pack converts Ember files into js files - I am not very expert in it though. But anyways the Image files are showing up in the folder only thing is they aren't accessible in web page and they are not loading in the resource section when I checked using Chrome Developer tools, and similar scenario, when I use Chrome Dev Tools, Image files are loaded and showing-up in the resources section and it works locally though - any help please
|
|
|
|
|
As I already mentioned in the thread below I know nothing about Ember. And without some actual code that people will be able to read it will be impossible to even guess at a suggested course of action. The best I can offer is that you go to Ember.js - A framework for ambitious web developers[^] and try there.
|
|
|
|
|
Start by using the dev tools of your browser. Look at the network tab to see when the images are being loaded. Look at the url it is accessing and the response code. It might be they are missing, it might be security, might be looking in the wrong folder, might be looking on your local machine, could be the wrong http method, could be a case issues....it could be anything, we can't access your machine so can't tell you. You need to use the tools at your disposal to at least find out what the issue is, and once you know the underling problem you can work toward a solution.
|
|
|
|
|
Thank you - yes I did, finally found that the webpack is not adding full url and it got fixed - thank you.
|
|
|
|
|
Greetings.
I am working on a one-page solution where each section has an ID.
I have made this very simple responsive menu, which looks quite nice, but I have noticed one major flaw.
In mobile view, if I click on a list from the navbar slide-menu, the page will scroll down to that particular ID. The problem is that the user needs to click on the navbar to manually close it, meaning that if they click on one of the links, they won't actually know if they are taken to that section, because the menu is in the way.
What I want is for the menu to close after clicking the link, so that people can see the page scrolling down to the section they were looking for.
How can I accomplish this?
If possible I would like an ES6 solution without JQuery
console.clear();
const navSlide= ()=> {
const burger = document.querySelector('.burger');
const nav = document.querySelector('.nav-links');
const navLinks=document.querySelectorAll('.nav-links li');
burger.addEventListener('click', () =>{
nav.classList.toggle('nav-active');
navLinks.forEach((link,index) =>{
if(link.style.animation) {
link.style.animation=''
} else {
link.style.animation=`navLinkFade 0.5s ease forwards ${index /7 + 0.2}s`;
}
console.log(index / 7);
});
burger.classList.toggle('toggle');
});
}
navSlide();
modified 17-Dec-19 15:03pm.
|
|
|
|
|
Hi - I am getting this following error when I am running an Ember application
Attempted to register a view with an id already in use: 2
- can somebody please help me in finding what would be the reasons for this error and how to fix them - any help would be very very helpful as I am new to Ember - thanks a lot
|
|
|
|
|
I know nothing about Ember, or even what it is, but I would say that message is fairly clear.
|
|
|
|
|
I know nothing about Ember, or even what it is, but I googled that error message and found a few articles that explain the problem and the solution. Have you done that yet? Have you tried any of those solutions? If any didn't work then say which ones and why.
|
|
|
|
|
|
Hi,
I appreciate your efforts to search by your own. However, here is some information about Ember.Js might helpful for you. "Ember.js is an open-source JavaScript web framework, based on the Model–view–viewmodel pattern. It allows developers to create scalable single-page web applications by incorporating common idioms and best practices into the framework. Ember is used on many popular websites, including Apple Music Square, Inc. Wikipedia"
|
|
|
|
|
Oh no, another JavaScript framework!
First time I've heard of Ember personally, or maybe I've read about it but didn't investigate.
Well, since the user pool is sooooo small, it's going to be hard to get help with it.
Looks to me like most of the help is outdated, and is polluting the inter webs with bad info.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
modified 12-Dec-19 15:11pm.
|
|
|
|