What's the point of using <b:skin> if I can use <style>? Blogger - html

I can't find a good source of information about this. Why would I want to use <b:skin>, <b:section>, <b:widget> if there is a possibility to create a page without that? And what advantage is there of using those?
Also I have to necessarily include one <b:section>, but it's possible to leave it empty. Why is this including mandatory then?

Related

is it possible to change text at the touch of a button in HTML

I have a problem where I need to change the displayed text between two different writing styles and wanted to ask if such a thing is even possible in HTML.
so like I my head I'm thinking about putting the text as a variable and saying
if output = 1:
display simple_text:
else display complex_text:
Here, the complex and simple text would be the variables the text needed to change is set to.
Thanks in advance for answering and reading my question
HTML is a markup language intended to describe the structure of a document in a both machine- and human-readable way.
As such, HTML doesn't have any logic like if...else or loops.
So to do what you want you will either need a template engine (which would decide at serve-time which text would be displayed, on the server), or Javascript, to implement the logic on the client-side (browser). Note that Javascript can be used on the server as well if the server runs Node.js.
To decide which one to go for, here's some cornerstones:
If the decision which text to display must only be made once - and won't change after that, going for a template engine on the server-side is probably the best approach.
If what is to displayed depends on some actions the user can perform (like you mentioned, clicking a button), go for a Javascript-based approach in the browser.

How to blacklist additional HTML tags in MediaWiki?

I really dislike the non-semantic usage of <big> on our wiki, and would like to prevent it. Flat-out commands didn't work so far, so I'm switching to doing it by code...
AFAIK, there's no configuration switch to control the blacklist/whitelist of HTML tags. Looking at the source code, it seems like the data is coming from Sanitizer::getRecognizedTagData(), while the work itself is done in Sanitizer::removeHTMLtags(). However, I do not see a way to add to the list myself, except using one of the hooks before or after (InternalParseBeforeSanitize, InternalParseBeforeLinks) and either:
Call Sanitizer::removeHTMLtags() again myself, with the additional tag to blacklist as a parameter
Do a search myself on the text to remove all the <big> tags.
The first one is a duplication of work, the second one is a duplication of code. Is there a better way? What would you recommend?
No coding is needed: just install AbuseFilter and create a rule that warns or disallows on save of pages containing these tags.

How to prevent duplicate HTML IDs?

The HTML standard doesn't allow duplicate IDs in the same document, but what are the tools web developers can use to enforce this requirement?
Some difficulties developers are faced with:
JavaScript can create IDs dynamically, so static checks don't always work.
Libraries being used may also create IDs in the document, and not all those IDs are named by developers.
If your using an ide like dreamweaver there is orange dots on the same line as your id.
Best way to avoid having more than 1 id is to only use id's for structural stuff or something you know there is only going to be 1 of and classes for everything else.
Hope that helps 😎

Is it possible to use the URL to change the CSS being applied?

I have two pages that have related topics, and share a significant amount of data & text between the two pages.
Since these two pages are both linked to from the same location, side by side, I am wondering if I can use an argument with the link to change the CSS being applied and have ALL the data on one page.
The original setup:
domain.com/subdir/one.page.php
domain.com/subdir/two.page.php
Can I use this instead?
domain.com/subdir/full.page.php?one
domain.com/subdir/full.page.php?two
And with that, have the page selectively use the CSS visible attribute to change what is actually displayed on the screen?
No, the CSS cannot be affected by the URL.
Instead, you should use a server-side programming language to only display the appropriate content.
You could use PHP include statements to prevent duplication.

Adding ids to HTML tags for QA automation

I have a query In our application we have lots of HTML tags. During development many tags were not given any id because of no requirement.Now the QA team wants to automate the test cases using QTP. In most of the cases this tool doesn't recognizes because it does not find ids for most of the HTML tags.Now we are asked to add ids to all the HTML tags.
I want to know if there will be any effect adding id attribute to these tags. Even positive impact are welcome
I do not think there will be any either positive or negative effect : maybe the size of the HTML page will increase a bit, but probably not that much.
Still, are you sure you need to put "id" attributes on every HTML tag of your pages ? Wouldn't only a few of those be enough ? Like on form fields, on links, on error-messages ; and that's probably about it ?
One thing you must take care, though, is that "id", as in "identifers", must be unique ; which implies it might be good, before starting adding them, to define some kind of "id-policy", to say, for instance, that "ids for elements of that kind should be named that way".
And, for your next projects : have developpers add those when theyr're developping ;-)
(And following the policy, of course)
Now that I'm thinking about it : a positive effect might be that it'll be easier to write Javascript code interacting with your HTML document -- but that'll be true for next projects or evolutions for this one, when those id are already present in the HTML at the time developpers put the JS code in place...
Since there are no QTP related answers yet.
GUI recognition in QTP is object-oriented. In order to identify an object QTP needs a unique combination of object's properties, and checking them better to be as fast as possible - that is why HTML ID would be ideal.
Now, where it is especially critical - for objects that do not have other unique identifiers. The most typical example - html tables. Their contents is dynamic, their number on the page may vary. By adding HTML ID you allow recognition mechanism get straight to the right table.
Objects with other unique properties can be recognized well without HTML ID. For example, if you have a single "submit" link on the page QTP will successfully recognize it by inner text.
So the context-specific answer: don't start adding ids to every single tag. Ask automation guys to prepare a list of objects they have problem with. And add ids to those objects.
PS. It also depends on automation programming skills. There are descriptive programming and dynamic recognition methods. They allow retrieving the right objects even without ids provided.
As Albert said, QTP doesn't rely solely on elements' id, in fact due to the fact that many web applications generate different ids for each session, (as far as I remember) the id property isn't part of the default description for most web test objects.
QTP is pretty good at recognizing most simple web controls and if you're facing problems it may be the case that a Web Extensibility project will help you bridge the gap between the semantics of your web application and the raw HTML it is created in. If a complex control is recognized by QTP as a WebElement (which is actually the div that contains the span that drives the code) you will understandably have object recognition problems since there are many divs on the page but probably many less complex controls.
If you are talking about side-effects - NO. Adding ids won't cause any problems (apart from taking up some extra bytes of course)
If you really have the need to add ids, go ahead and add them.
http://www.w3.org/TR/html4/struct/links.html#anchors-with-id says: The id and name attributes share the same name space. This means that they cannot both define an anchor with the same name in the same document. It is permissible to use both attributes to specify an element's unique identifier for the following elements: A, APPLET, FORM, FRAME, IFRAME, IMG, and MAP. When both attributes are used on a single element, their values must be identical.