Add event on dynamic change of DIV [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I have a page (Facebook page) that has its content changing dynamically. I am writing a GM script but it only loads when the page refreshes, and this is not the case. I have tried to do something like:
mydiv.addEventListener('load', myfunc() ,false );
as I saw in a different thread, but it didn't work. What am I doing wrong?
Thanks.

Use setInterval() or the waitForKeyElements utility.
Can't give any more detail unless you provide specifics like: what, exactly, you are trying to do; before-and-after HTML; or even a link to the page and/or screenshots.

Change myfunc() to myfunc.
Using myfunc(), you are calling the function.
While myfunc is just passing the reference to your function.

Related

Wix Revision and Modification [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 days ago.
Improve this question
So i'm trying to rewrite and revise code for my friend to help make his website better, i've removed a lot of the redundant code, and revised a lot of it, as well as separated some of the CSS components into an actual CSS file.
After I tried adding an email service for his website, the "submit" button grew to an insane size, and won't let you type anything in it.
i've tried to reduce the size in CSS but it didnt work. attached is the screenshot of what i'm talking about; there should be a "name" and "email" input box there but there's only the HUGE submit button
This is the code i've tried implementing as of now:
``<form class="pUnTVX"
action="https://formspree.io/----"
method="POST"
Your email:
Your message:
Send
`
`
i expected it to just work as expected, i've used code like this before on trial markups, but i've never encountered this problem.

On click effect (CSS, HTML, JAVASCRIPT) [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I don't know how to get "onclick" effect. I mean how to open new site by click menu. Below i attached example. Please tell what can i do.
https://bslthemes.com/ryan/demo/index-new-no-photo.htm
With addEventListener you have an univerdal method to respond on the click event. Instead of <div> you may use <button> or any other element, that's up to you.
<div id="whatever">Click me</div>
<script>
document.querySelector("#whatever").addEventListener("click", function() {
window.location.replace("https://stackoverflow.com/");
});
</script>

Can I get time of web page loading [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to do a pre-loading for a website:
I want to create a loading page/image/etc. to show before the actual
page is loaded.
Nice would be something like a spinner/loading-bar
The pre-loader shell vanish when the actual page is fully loaded
How can i achieve this?
You should check if all elements of webpage are loaded.
You can use JQuery, for example:
$(document).ready( function() {
// something here
})
From jQuery documentation:
The .ready() method is generally incompatible with the attribute. If load must be used, either do not use .ready()
or use jQuery's .load() method to attach load event handlers to the
window or to more specific items, like images.
I don't know your programming skills, but if you are aware of javascript and jQuery you could easily try this tutorial:
http://avexdesigns.com/create-a-jquery-preloader/
The Plugin you will find here: http://www.inwebson.com/jquery/jpreloader-a-preloading-screen-to-preload-images/
and all about jquery is found here: http://jquery.com
You can have a progressbar in ur webpage before loading ur actual content.
Refer the link below.
http://tutorialzine.com/2013/09/quick-tip-progress-bar/

JavaScript script reloader [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Im a little new to HTML programming so I wasn't sure what to do. Im trying to make this script that I have written reload constantly (every second) without refreshing the page. I know that it is supposed to be using the tag but Im not sure what to put after. Thank you for reading, hopefully someone will help.
I think you mean reload without user interaction. You don't need javascript. Place this in <head>
<meta http-equiv="refresh" content="1" />
or if you really want to use JS, place this before </body> (or before <head/> if you're old school).
<script>
window.onload=function(){
setTimeout(function(){location.reload(false)}, 1000);
}
</script>

What is inline javascript? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Me and my programmer has 2 different views for what "Inline JavaScript" is.
I said inline JavaScript means JavaScript placed directly in the HTML file, without in a .JS file.
My programmer means inline JavaScript is JavaScript on 1 line, and like <button onclick="alert('test')">
I give him right in, that inline JavaScript also is "onclick='alert(...)" because it again is like my solution #1, all JavaScript loaded in HTML and not in JS.
Who's right?
We have a HTML file, and there is <script>....</script> JavaScript in the bottom, that is inline javascript, right?
A script tag without a src (ie. with code directly in the HTML document) is referred to as an inline script.
An onclick="..." attribute is called an inline event handler.
I've heard the term used for both of those, I don't think either of you is "wrong." I'd say I've heard it used more for #1 than for #2. Most terms I've heard for #2 are more clunky, like "onxyz event handler" or "inline event handler" (thank you Niet the Dark Absol for reminding me) or "DOM0 attribute event handler" or sometimes just "DOM0 handler."

Categories

Resources