I'm an old hand on programming but a wet-behind-the-ears newbie on webprogramming. I ran in to this in a project and I need help identifying the technique/language used.
It is some sort of dynamic web-page that fetches information from a database and displays it in a table. In the html-page that is used these tags are
<!-- some text that has to be some form of commands -->
What is it called? It is impossible to google either the starting tag or the closing tag :/
I know that it somehow uses a c-program to do the actual fetching of the data, but i'm at a loss how it actually works.
What I need is the name so I know what to look for in the form of online resources to learn this and I do hope that this kind of tag-usage is only used by one type of language/technique :)
thanks in advance from archie!
Those tags are just html comments. It's possible that they're being used in a template file, and a server-side scripting language is doing some kind of search/replace to execute commands on the template. If so, it's impossible to say what language it is.
This looks like an HTML comment
http://www.w3schools.com/tags/tag_comment.asp
lessthan-bang-dash-dash is a comment, which closes at dash-dash-greaterthan.
Its a HTML comment, if you need further information http://www.w3schools.com/tags/tag_comment.asp
;)
The tags you posted in code are Comment Tags. They are for adding non-functional comments to code to help readers understand what is being done in the code.
Related
To give a little context, I am working with BigCommerce theme template files right now, and I do not understand some of the syntax.
They use a double percentage sign to wrap certain things in the document. An example:
<!-- Include visitor tracking code (if any) -->
%%GLOBAL_TrackingCode%%
%%GLOBAL_DesignModeStyleSheet%%
%%GLOBAL_HeaderImageStyle%%
They will also be included in source attributes sometimes, like this:
<script type="text/javascript" src="%%GLOBAL_TPL_PATH%%/js/imagesLoaded.js"></script>
I can't for the life of me figure out what the %% means.
Hopefully that will give enough info to answer the question, if anything else is needed let me know. If this is not a JavaScript thing like I assumed, feel free to move it to the appropriate category.
Thank you in advance!
It appears to be a templating tool, that the people who made the template would change according to what they want to put in there.
This is not JavaScript, it's clearly a templating language's marker for variables.
A good programer believes in code re-useability. I am in new HTML and CSS programming. when i code in HTML i have to write my full code in one HTML file. often many programming logic and code repeats in my code. Is there a way to reuse my code? Does function concept work in HTML?
here i am attaching my code where i have to write following lines repeatedly:
login|
logout|
profile
Just to give you an overview that I thought about.
Directory Structure:
Root
includes
navigation.php
about.php
So on navigation.php you have the following code.
login| logout| profile
Then on about.php by using include function on php put it on your about page.
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<?php include ('includes/navigation.php'); ?>
<h1>Hello</h1>
</body>
</html>
There you go.
If you're on PHP, try to Learn Laravel, it's nice. Laravel Link
Edit
I just realized that there's no PHP involved lol.
The best i can think of this:
<!--#include virtual="login.html" -->
ie, use the Server side includes otherwise I dont think so it is possible. Also to note that HTML is a markup language, so code reusability is not something where you have to focus upon.
Firstly, please note that HTML, XML isn't code, it's markup language. :)
Secondly, consider using Template Frameworks in combination with a scripting or programming language. That should promote re-usability of your markups.
ie. PERL with Template Toolkit, PHP with SMARTY, etc.
This is possible in css through Class
.common{Write propert there which is common}
but not possible in html.
Unfortunately HTML is not a programming language, so code reusability can't happen in the way that you think it will. If you however are trying to do a navigation panel or something like that, you can take a look at using iFrames to achieve what you want.
This will help you to include already created HTML files within another.
You can find a tutorial on IFrames here.
This is if you don't want to make use of a scripting language. You will most probably need one.
Hope this helps!
sorry for this ultimately newb question. I want to create a menu and not have to repeat the code of the menu on every single web page. I have done this with iframes in the past, but I know they aren't recommended. I have a pretty decent knowledge of HTML & CSS but I feel like I am missing something big here.
I am also not looking for the PHP solution which I believe is represented by:
<?php include("navigation.html"); ?>
Is there a good tutorial I can follow? I've heard this can be done with XML but I haven't been able to find what I am looking for exactly, and don't have any knowledge with it in the past.
In what I think is a related problem, I want to be able to place my google analytics code on just my index page and have it reference the entire website of pages, not just the index. Again, what am I missing here? Do I need to be using a content management system of some sort to pull off this slightly dynamic task? I don't think so...
Thanks for your help and please let me know if I can clarify my question any better!
Why don't you want to use PHP? It can be done with JavaScript (using AJAX), but you need to provide search engines with a way to crawl your site if you go that route.
Using includes in PHP to achieve this is simple and requires extremely little knowledge. Much easier and more efficient than doing it with JS. Also, I don't see how XML would be of any help here unless you read it in with JS (in which you'd have the same issue mentioned above.)
Use server side includes as mentioned already. They are support by pretty much all major webservers so php is not even required.
Check out the following articles:
http://en.wikipedia.org/wiki/Server_Side_Includes
http://httpd.apache.org/docs/1.3/howto/ssi.html (from apache, note no php needed)
http://www.boutell.com/newfaq/creating/include.html
Good Luck
I'm not really sure what options you have other than a .php include. I'm not sure of why you would be avoiding PHP unless the server didn't support it, as it's very simple to do an include (you really don't even need to know PHP to do this except for the include statement).
For your analytics code, you could put this in a .js file and just include it on every page:
<script type="text/javascript" src="analytics.js"></script>
Hope this was at least slightly helpful.
How about javascript? You could write a Javascript file that is included on each page that you wish to display the menu. The javascript could read an XML that contains your menu items and generates HTML to display the menu.
Parse and XML document with JS
http://www.w3schools.com/Xml/xml_parser.asp
jQuery menu solutions
http://speckyboy.com/2010/12/01/15-super-simple-jquery-menu-and-navigation-plugins/
I have a large HTML file, and it looks like some tags are not closed. It's hard to find it. I am using VIM as the editor.
Is there any good way to find it?
You can validate your html using http://validator.w3.org/
Just make sure you specify the DOCTYPE correctly and it'll find anything that is invalid.
I assume you are on running Linux?! If so, you could try Eclipse
It is a complete IDE, which will help you in many cases and make programming a lot more efficient
Just use Notepad++. It is free and light weight code editor, and I already found many unclosed tags in my html with it...
HTML Validator (extension for Firefox) has helped me in the past. You need to load the page in the browser to find the errors.
If you can put you code online you could try Dr. Watson.
Another validator to try is the CSE HTML Validator. The online version is here:
http://www.OnlineWebCheck.com/
I'm using Perl.
I have the tag, for example: "XYZ_PKM_HTML"
I would like to be able to provide a base url, for example: www.example.com
and the to get the HTML page (not necessarily the main page, thats easy) where this tag appears.
is it possible? any idea? (or already made modules, looked on cpan, there were some interesting stuff, but not installable)
Thanks,
MJD has an extended example on writing a web spider in Higher-Order Perl. It is section 4.7. See page 187 in Chapter 4.
Of course, you can also try the WWW::SimpleRobot module he mentions.
You seem to want to implement a web site crawler and a searcher. You usually do the former with WWW::Mechanize and the latter with HTML::Twig
Try Web-Scraper in Perl. Web-Scraper module info.
It is easy to work with and you can search for specific tags or elements and get the data from it.