I'm working on an existing page. And there's a button on the page. It's like:
<html>
<script src="..."></script>
...
<div><input>...</input></div>
</html>
After click the button, a pop up dialog page(it's a fully functional page, not just displaying some messages) will show. It's like:
<html>
<script src="..."></script>
...
<div><input>...</input></div>
<div>
<iframe>
<html>
<script src="..."></script>
<form>
...
</form>
</html>
</iframe>
</div>
</html>
In the new page, I have to load all the necessary script again which takes a lot of time.
My question is:
I'm doubtful about this kind of implementation, can someone comment on this?
what's the best practice for this kind of scenario(open a new dialog page)?
Related
Im looking to figure out how to compile a couple of html pages into one page. like if i made a triangle in one html page, how would i link it with another html page that has a rectangle for example so that they both show up in one page. of course im not trying to figure out how to do this specifically but i want to generally know how to do it.
With jquery you can do it like so:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(function(){
$("#includeContent").load("fileName.html");
});
</script>
</head>
<body>
<div id="includeContent"></div>
</body>
</html>
source: https://www.codegrepper.com/profile/abutahir
I am trying to create a simple google plus post page that take text from text box and when click on google sharing button text will be posted automatically. Here is my code I am using.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Forms</title>
</head>
<body>
<form>
<div>
<label for="example">Let's submit some text</label>
<input id="example" type="text" name="text">
</div>
<div>
<g:plus action="share"></g:plus>
<script >
window.___gcfg = {
lang: 'zh-CN',
parsetags: 'onload'
};
</script>
<script src="https://apis.google.com/js/client:platform.js" async defer></script>
</div>
</form>
</body>
</html>
Its a simple html page. I use form submit option. I am beginner, so I am not exactly getting why it did not take text from text box.
The only configurable content attribute for the Google+ share button is data-href and it goes directly on <g:plus action="share" data-href="https:/example.com"></g:plus>. The only other configuration the share button supports is for how it will be displayed.
The Google+ share button only supports sharing URLs and does not support sharing text.
You could try using interactive posts but they require a lot more setup and a call to action.
I am developing a website , I have an html page which has some contents, have also made a signUp modal in the same page, but the code is getting longer, I just want to know if I keep the code of sign up modal in another file with .html/.htm extension, and on button click that modal is displayed on the same page, not to be redirected to another page, like it is displaying on the home.
I don't want the home contents to be shattered , just the modal to be displayed on above.
You can use jquery to accomplish this task:
Just create a new file "modal.html" and write code for popup there.
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script>
$(function(){
$("#header").load("modal.html");
});
</script>
</head>
<body>
<div id="header"></div>
<!-- other code -->
</body>
Use w3data and include your file where ever you want. In blow i included signup.html file.
<!DOCTYPE html>
<html>
<script src="http://www.w3schools.com/lib/w3data.js"></script>
<body>
<div w3-include-html="signup.html"></div>
<script>
w3IncludeHTML();
</script>
</body>
</html>
Simple Method to load Html File to main
$(function(){
$('#which').load('test.html');
});
you can write inside document.ready also
Simply use an iframe (inline frame) to load the external webpage. You can style the size of the iframe like you normally would with any HTML element.
<DOCTYPE html>
<html>
<head>
...
</head>
<body>
<iframe src="/your-signup-page.html"></iframe>
</body>
</html>
More information on the iframe element.
As I try to modify content in the html panel in firebug the focus goes elsewhere and I have to click & type very quickly before it goes again.
If I press break on mutate, the focus does not wander, but then it breaks on mutate...
Is there an option I have enabled that is causing this?
I had this issue too. On the HTML tab there is a drop-down arrow. Click on it and unselect the option, "Scroll Changes Into View". If you are on a webpage that actively tracks the mouse or has constant javascript going on, it is very likely that this is the culprit.
I don't know about an option but it sounds like some script is writing to the page and interfering with your ability to edit. But checking that, my firebug lets me edit even the field that is being modified.
This is Firebug 1.8.4 on firefox 8
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
setInterval(function(){
$('body').addClass('xx'+Math.floor(Math.random()*100));
},2000);
});
</script>
</head>
<body>
</body>
</html>
i need to display the section as PopUp while onload(). but i don't know how to call this javascript function(function($)). name has confused me. also if any other way to call this div section as popup .please sugesst. Thanks
<html>
<head>
<script>
// function name is function($)
function($){
}
</script>
</head>
<body>
<div>
<!-- body of the popUp -->
</div>
</body>
</html>
The $ function is probably the one defined in jQuery, so you will need to include the jQuery JavaScript library if you want to use it for showing a pop up.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
Including just this library will define the $ function and you can then use jQuery functions in your JavaScript code. However this will not create a pop-up. There are many jQuery plugins that can be used to create a pop-up.
jQuery dialog?
http://jqueryui.com/demos/dialog/
Loads of examples on there