SunQuest
 
           Web Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old June 14th, 2006, 10:24 AM
SnapCracker's Avatar
SnapCracker SnapCracker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, United Kingdom
Posts: 165 SnapCracker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 21 h 22 m 31 sec
Reputation Power: 4
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

Reply With Quote
  #2  
Old June 14th, 2006, 04:08 PM
Kravvitz Kravvitz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: USA
Posts: 134 Kravvitz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 38 m 30 sec
Reputation Power: 4
So what's your question?

Reply With Quote
  #3  
Old June 15th, 2006, 04:01 AM
SnapCracker's Avatar
SnapCracker SnapCracker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, United Kingdom
Posts: 165 SnapCracker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 21 h 22 m 31 sec
Reputation Power: 4
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.

Reply With Quote
  #4  
Old June 15th, 2006, 05:01 AM
Kravvitz Kravvitz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: USA
Posts: 134 Kravvitz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 38 m 30 sec
Reputation Power: 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.

Reply With Quote
  #5  
Old June 15th, 2006, 07:48 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
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

Reply With Quote
  #6  
Old June 15th, 2006, 07:50 AM
SnapCracker's Avatar
SnapCracker SnapCracker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, United Kingdom
Posts: 165 SnapCracker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 21 h 22 m 31 sec
Reputation Power: 4
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.

Reply With Quote
  #7  
Old June 15th, 2006, 07:57 AM
SnapCracker's Avatar
SnapCracker SnapCracker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, United Kingdom
Posts: 165 SnapCracker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 21 h 22 m 31 sec
Reputation Power: 4
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.

Reply With Quote
  #8  
Old June 15th, 2006, 02:25 PM
Kravvitz Kravvitz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: USA
Posts: 134 Kravvitz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 38 m 30 sec
Reputation Power: 4
Can you show us some examples of companies that do this?

Reply With Quote
  #9  
Old June 15th, 2006, 03:13 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
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...

Reply With Quote
  #10  
Old June 15th, 2006, 03:47 PM
Kravvitz Kravvitz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: USA
Posts: 134 Kravvitz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 38 m 30 sec
Reputation Power: 4
I'm pretty sure that Google does that mainly to save bandwidth.
Comments on this post
MadCowDzz agrees: Chances are one benefits the other... either way, Google wins because I can't easily steal their
code...

Reply With Quote
  #11  
Old June 16th, 2006, 11:01 AM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 542 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 2 h 49 m 17 sec
Reputation Power: 3
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Development > View source code - no thanks!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway