|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
||||
|
||||
|
View source code - no thanks!
Alot of beautifully created websites that have a whole lot going on, are very disappointing when viewing there source code and usually call in functions so they end up with a few lines of code. Well OK, that's fair, as they probably worked hard on their code and they don't want snotty oiks like me stealing their code. And so these days, I'm having that feeling after spending hours of my time getting it right in front on dreamweaver (crashing and loosing my work!) Spending hours trying to explain things to MadCowDzz! Is that a selfish thing to think? If anyone doesn't think so and knows the general concept of achieving this I would love to know. I use php/MySQL and already use functions to make connections etc but how do I use this in html or javascript. If this a tiny question that has a huge answer, I'm sorry!
Cheers |
|
#2
|
|||
|
|||
|
So what's your question?
|
|
#3
|
||||
|
||||
|
Sorry, I should have not rattled on; quite simply, how do call in big chunks of code from a webpage so if someone views the source of the page, it appears that there is only a few lines of code.
|
|
#4
|
|||
|
|||
|
Don't. X/HTML, CSS, and JavaScript are open-source. Live with it.
You could do it with JavaScript, but doing that is just plain wrong -- for many reasons, including the fact that most, if not all, search engines ignore JavaScript in web pages. |
|
#5
|
||||
|
||||
|
I think if you're using PHP you can simply use includes...
Put all of your "big chunks of html" in a file and call it with include('file.htm') On a lighter note... Yay, he said me name! ![]() ![]()
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#6
|
||||
|
||||
|
OK fine! I knew it was a touchy issue, that's why I tried to elaborate unsuccessfully before without getting to the point! However, a lot of huge companies do just that.
|
|
#7
|
||||
|
||||
|
Yes MadCowDzz, you are the next best thing from Canada apart from The Bare Naked Ladies! saying "I don't get it, I don't get it!" to everyone in London heading down Regents Street of that open top bus.
|
|
#8
|
|||
|
|||
|
Can you show us some examples of companies that do this?
|
|
#9
|
||||
|
||||
|
I think this relates somewhat to another thread here (I don't think you started that one?) where I reluctantly suggested code obfuscation. I know Google modifies all their Javascript variable names to be simple, like a,b,c... they also remove all the white space, making the script extremely difficult to read.
On the other hand... many corporations use Content Management Systems which do the exact opposite... they seem to bloat the code, although I assume unintentionally, and make the code extremely difficult for external developers to read. In some cases, code that looks extremely condensed despite a complicated layout code be the result of good use of web standards and CSS. ![]() On a personal note... it almost makes me proud as a Canadian to finally be known for BNL instead of Bryan Adams or Celine Dion... ![]() |
|
#10
|
|||
|
|||
|
I'm pretty sure that Google does that mainly to save bandwidth.
|
|
#11
|
||||
|
||||
|
externally referenced files
I don't think that referencing external files is so much about protecting code as it is about reusability. True many users don't know it, but all externally referenced files go to a "temp cache" and can be saved/seen from there. Using externally refenced files make maintenance a lot easier. If I have a CSS file as opposed to inline styles on every page, I make a change in the CSS file, and all pages that use it reflect the change. Similarly with javascript files. True it does "trim down" the individual pages' source code too, but it is a lot easier to change 1 js file than every page.
As to PHP I do something like <?php include "header_section.php"; include "left_nav_section.php"; include "content_template.php"; $page_content = new Template; $page_content->title("Contact Info"); $page_content->page_copy("blah, blah, blah"); include "footer_section.php"; ?> This allows me to make easy changes to the "includes", and focus on the page's content more easily. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Development > View source code - no thanks! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|