Console Javascript Tag - console

How do I make a link-text? I want to show how I tried do it. BeforeAfterResult

In HTML, links are defined with the tag:
link text
Example:
<!DOCTYPE html>
<html>
<body>
<h2>HTML Links</h2>
<p>Visit google</p>
</body>
</html>
with javascript see here How do I create a link using javascript?

Related

Html anchor in another html

Suppose I have two html files footer.html and main.html. The footer contains a reference to the top of a page as follows:
<!-- footer.html -->
<!doctype html>
<html lang="en">
<head></head>
<body>
<footer>
<small>To top</small>
</footer>
</body>
</html>
The main.html file embeds the footer by using the <object> tag (see note 1) as shown below. There can be several files similar to main.html. Because of this <a href="page#header"> may not be used.
<!-- main.html -->
<!doctype html>
<html lang="en">
<head></head>
<body>
<div id="header">...</div>
<div id="content"> Long content ... </div>
<object id="footer" type="text/html" data="footer.html"></object>
</body>
</html>
Question: Is it possible to refer to the anchor from the footer to main without using javascript, php etc?
Note 1: The <object> tag can be used to embed another html, although without a relation:
You can also use the <object> tag to embed another webpage into your HTML document.
from http://www.w3schools.com/tags/tag_object.asp
The same can be done using <iframe> or <embed> instead of <object>, but the issue remains.
Is it possible to refer to the anchor from the footer to main without using javascript, php etc?
No, it isn't.
If you use a relative URL, then it will be relative to the document that the link appears in (i.e. the footer).
If you use an absolute URL, then you have to specify which document you want to link to the top of (and since multiple documents will embed the footer, you can't do that).
You've ruled out generating the URL programatically with JavaScript.
Thanks to all for the comments and answers. Indeed, this approach seems not to work due to a missing relation between html files. In other words, footer.html cannot refer to the inside of main.html. Instead, I modified the structure, so that the main includes the footer directly and the content is embedded by using an <iframe> as follows:
<!-- main.html -->
<!doctype html>
<html lang="en">
<head></head>
<body>
<div id="header">...</div>
<iframe id="content" name="contentframe" src="content.html"></iframe>
<footer id="footer">
<small>To top</small>
</footer>
</body>
</html>
This solves the issue and works without JS, PHP or the like independently of the page loaded into the <iframe>. That is, it simply jumps to top keeping the contents of the loaded page. Eventually, there is one main and multiple long content pages which are loaded into this main. Tested with FF and IE.

ckeditor cdn not working when page loaded from file

I put the following (copied from the cdn website) in a file then opened it in FireFox A textarea is displayed rather than ckeditor. Is that expected behavior?
<!DOCTYPE html>
<html>
<head>
<script src="//cdn.ckeditor.com/4.5.7/standard/ckeditor.js"></script>
</head>
<body>
<textarea name="editor1"></textarea>
<script>
CKEDITOR.replace( 'editor1' );
</script>
</body>
</html>
Try this tutorial on how to setup and configure CKEditor in different environments, or get the demos' source code straight from github

Meteor: render body tag content on first site loading (for SEO)

I want to take something like this:
....
</head>
<body>
<h1>Some custom content for current route</h1>
</body>
</html>
instead of empty body tag:
....
</head>
<body>
</body>
</html>
Is it possible?
Learn how to use the Spiderable package in your project

Render Partial in WebPages without using MVC

I'm using Razor with WebPages but without MVC. I like the simplicity with this so I'm not interested in using MVC at this point. However I would like to be able to render a partial into my page. Like a menu, a footer, etc.
With MVC you can to this:
#{ Html.RenderPartial("Footer", Model);}
I would like to do something similar:
#{ Html.RenderPartial("footer.cshtml"); }
How can I achieve what I want?
take a look at this link http://www.mikesdotnetting.com/Article/151/Extending-ASP.NET-Web-Pages-Create-Your-Own-Helpers
Hope this will help you
also try this:
<!DOCTYPE html>
<html>
<head>
<title>Main Page</title>
</head>
<body>
#RenderPage("/Shared/_Header.cshtml")
<h1>Index Page Content</h1>
<p>This is the content of the main page.</p>
#RenderPage("/Shared/_Footer.cshtml")
</body>
</html>

Locating Element using XPath and CSS

How will you locate the element using its “Click Payment History” text using XPATH & CSS?
<html>
<head>
<title>My Account</title>
</head>
<body>
<table>
<tr><td>John</td></tr>
<tr><td>Shield</td></tr>
</table>
<div>Click Payment History</div>
</body>
</html>
In CSS:
div
In xpath:
//div
Not maintainable but they'll work for your example.
A way to find xpath is Firepath an extension of Firebug.

Resources