SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: How to put a piece of code on server and link it in

  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to put a piece of code on server and link it in

    I don't know what you call this but baicly I want to put a simple code from add this.com it's a scal network button. I want to put it on a word pad on my server then just link it on each page were I want it to appear.

    I want to do this for 2 reasons, mainly cuz my sit builder NVU is removing empty <a> tags which are required fr this code. And also his code as a little in loading up. Hadly noticeable lag , but still.

  2. #2
    It's all Geek to me silver trophybronze trophy
    SitePoint Award Recipient ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    20,012
    Mentioned
    217 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by website_designer View Post
    I want to put it on a word pad on my server
    That doesn't make a lot of sense. WordPad is a program on your desktop, not on your server. Are you saying that the code editor you use is stripping out the code? If so, get a better one.

    Alternatively, you could log in to your website's control panel (if there is one) and enter the code that way. But it's not really quite clear what the situation is right now, so feel free to clarify exactly what you are seeing.

  3. #3
    Robert Wellock silver trophybronze trophy
    SitePoint Award Recipient xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,243
    Mentioned
    51 Post(s)
    Tagged
    0 Thread(s)
    It sounds like you are wanting to use simple Server-Side Includes, which are typically plain text files - containing text or code - that get included/inserted into your webpage server-side. Though I suspect you are probably also doing something wrong regarding the AddThis button as usually those type of things are just simple snippets of code.
    };-) http://www.xhtmlcoder.com/
    Thinking Web: Voices of the Community

    > March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?

  4. #4
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    746
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    To prevent NVU stripping out empty anchors you could try inserting the Invisible Separator entity into the code in Source view.

    HTML Code:
    <a>&#8291</a>
    On the Mac version at least, when next returning to Source view the entity is - true to its name - no longer visible, but can be deleted if required by placing the cursor between the anchor tags and forward deleting.

    As xhtmlcoder says, Server-Side Includes are a useful way of adding frequently occurring elements across multiple pages.

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    XHTML coder that's what I want to do I know the add this button is simple copy paste like I said the NVU is messing p the code. I do or want to have to edit it every single page in any program alright Ralph. I don't want a better program alright Ralph. Geezus.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •