/    Sign up×
Community /Pin to ProfileBookmark

Cross-browser copy-source-code-to-clipboard script?

Hi all,

I’ve had a look around but can’t seem to find a cross-browser script that:

  • 1.

    Allows a user to click on a link that copies the entire source code of the page they’re on to their clipboard

  • 2.

    Once the source code is copied, the script opens a new browser window (not a pop-up) and takes them to the direct code input page of the w3c validator

  • It’s for my html5 CV (trying to get a job as a web designer… just html and css thankfully).

    thanks all for any help

    to post a comment
    JavaScript

    17 Comments(s)

    Copy linkTweet thisAlerts:
    @chrisecclesJul 27.2011 — AFAIAW, the w3c validation logo link does exactly what you want !

    ;-)

    Chris
    Copy linkTweet thisAlerts:
    @W8_4meauthorJul 27.2011 — Thanks chris, although this site doesn't appear to list html5 yet as a logo-able standard http://www.w3.org/QA/Tools/Icons

    Presumably I still use the same code but use the html5 logo from another part of the site?

    I'll give it a go...

    thanks ?
    Copy linkTweet thisAlerts:
    @chrisecclesJul 27.2011 — It would be better to code as XHTML 1.0 Strict, and have

    w3c validate that.

    The web designer's equivalent of having an "Institute of

    Advanced Motorists" badge on your front bull bar ! !

    ?

    Chris
    Copy linkTweet thisAlerts:
    @W8_4meauthorJul 27.2011 — Cheers, but employers are looking for both xhtml and html5 now, and my plan was to make a xhtml 1.1 CV and a separate html5 CV, so i guess i'll just have to link to the direct input page and do with that.

    thanks anyway ?
    Copy linkTweet thisAlerts:
    @chrisecclesJul 27.2011 — Employers ( and I count myself in the category ) will be more

    impressed by your proven ability to code to strict standards-compliance

    (XHTML is a demanding beast) than they will by any specific reference

    to HTML5 which, after all, just demonstrates that you can read the new

    lists of attributes and tags !

    Good luck with it, btw.

    ?

    Chris
    Copy linkTweet thisAlerts:
    @W8_4meauthorJul 27.2011 — Ok, but I've got to show something of HTML5. I can't really not do this since employers are advertising for people who can do HTML5, and I think it'd be an error not to include HTML5 for jobs that specifically advertise for it. ah well!
    Copy linkTweet thisAlerts:
    @chrisecclesJul 27.2011 — 

    Maybe you misunderstood me ?
    -


    Your original question related to getting a prospective

    employer to check that your code was validated. The current

    and, IMHO, best way to do this is with a w3c XHTML logo link

    because it is so inflexibly coupled to compliance.

    The niftier features of the site you submit for assessment which

    depend on your having understood and utilised HTML5 will be

    pretty well self-evident to an experienced designer/manager.

    Chris
    Copy linkTweet thisAlerts:
    @KorJul 27.2011 —  The current

    and, IMHO, best way to do this is with a w3c XHTML[..][/QUOTE]

    HTML5 Doctype will validate (almost) either XHTML [I]strict[/I] syntax or HTML 4.01[I] strict[/I] syntax, thus, if coding carefully and standard, both will pass the HTML5 validation...
    Copy linkTweet thisAlerts:
    @W8_4meauthorJul 27.2011 — While we all understand that, I've worked with managers who have less knowledge of the field that they're about to employ someone in. So I guess I want to make this - wanting a less offensive phrase... idiot proof.

    I don't want to be disconsidered for a job because a manager sees "validates as HTML5" from my xhtml CV or vice-versa and think "This guy can't even get the validation right"... then throw my CV in the bin!

    So I want my xhtml CV to validate as xhtml, and I want my html5 CV to validate as html5. Unless there's a way to declare two doctypes in the same page that will support what I'm trying to do here?

    That aside...

    Line 113, Column 30: No p element in scope but a p end tag seen.

    <p><h1>Qualifications</h1></p>[/quote]


    ...doing my effing head in! The end p tag's there damnit!! I can see it!!!
    Copy linkTweet thisAlerts:
    @KorJul 27.2011 — Can we see your code(s)?

    But, for God's sake, why do you need an XHTML CV [I]and[/I] a HTML5 CV? Do you use the special features of HTML5 inside? In this case, an HTML5 CV is enough. It is presumable that if you know HTML5, you already know HTML 4.01 and XHTML, correct?
    Copy linkTweet thisAlerts:
    @W8_4meauthorJul 27.2011 — I was going to make two (graphically) different CV's, the xhtml one was going to showcase my (beginner level) photoshop abilities, and the html5 one was going to be showcasing the new html5 features.

    I see what you mean now, I can kill two birds with one stone.

    I've attached the code, as there were too many characters to fit in this reply.

    [upl-file uuid=d8530c8f-c8ef-4bfb-b100-865e491398c9 size=13kB]cv_code.txt[/upl-file]
    Copy linkTweet thisAlerts:
    @chrisecclesJul 27.2011 — 

    [CODE]<p><h1>Qualifications</h1></p>[/CODE]

    [/QUOTE]


    Why a heading [B]inside[/B] a <p> ?

    Just struck me as odd.
    -


    Should validate, though. Strange.

    Chris
    Copy linkTweet thisAlerts:
    @jamesbcox1980Jul 27.2011 — Whether or not HTML5 validates as HTML 4.0, the link that the OP provided saying it's not a "logoable" website actually has a logo at the very bottom for just that: http://www.w3.org/QA/Tools/Icons

    If you scroll to the bottom, you'll see ISO-HTML, an icon for file types vaildate-able, but not covered by the icons.
    Copy linkTweet thisAlerts:
    @W8_4meauthorJul 27.2011 — Why a heading [B]inside[/B] a <p> ?

    Just struck me as odd.
    -


    Should validate, though. Strange.

    Chris[/QUOTE]


    I'm guessing this is not a good idea? I never thought it'd be a problem. It just seems a bit brutal to use one or two br's to make this header start on a new paragraph line.

    As an employer in this field Chris, please would you give me your opinion on my coding/syntax? Is there anything you'd recommend? many thanks for your help!
    Copy linkTweet thisAlerts:
    @chrisecclesJul 27.2011 — 

    I PM'd you, anyway, but there [B]is[/B] a point to all of this:
    -


    Elegance for elegance's sake, in code, is not just a narcissistic

    preoccupation.

    You're going to be working as a pro and, anywhere except in the

    tiniest one-horse business, things are going to happen:

    • Two months down the line, when your employer decides to sell

    shidgets instead of spridgets, you are going to have to do re-writes

    and your code needs to be instantly readable.

    • Even while you're still working there, some other Harry/Harriet is going

    to have to use or re-use your code and you'll get no pints bought for

    you down the pub if he/she takes half a week figuring where your

    <div>'s start and end, and plucking all those <em>'s and <strong>'s

    out into style classes.

    White space is your best friend.

    Chris
    Copy linkTweet thisAlerts:
    @jamesbcox1980Jul 27.2011 — It just seems a bit brutal to use one or two br's to make this header start on a new paragraph line.[/QUOTE]

    By default, headers do start on a new line, unless you're modifying them by element attributes or through the CSS. Also by default, they have margins above and below them and a larger font size.

    [code=html]<h1>Lorem Ipsum</h1>

    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua...</p>[/code]
    Copy linkTweet thisAlerts:
    @chrisecclesJul 28.2011 — I suppose this ought, by right, to be taken to the HTML/CSS

    forum :rolleyes: but W84me will sink or swim on how well he

    can present his design [I]intentions[/I] to an employer, not necessarily

    his design [I]achievements[/I]. Every job is different.

    I was once told that one should start every project with an HTML

    file that contains only text, <img> and <a> elements and then

    massage that with a style sheet until the page looks precisely like

    the client's brief ! There are still many occasions on which this kind

    of discipline produces a compact, elegant and browser-compatible site.

    It also forces you to think clearly about what the client wants.

    That said, there are occasions where the desired functionality can only

    be achieved by some nifty AJAX, or the desired visual impact can only

    be achieved by using JS to fade or move imagery, etc., but a solid and

    simple styled page foundation is always the best starting point.

    Avoid Javascript frameworks if what you want to do can be done with

    a three-line function; avoid MySQL if all you need to store is a user's

    IP address in a text file; etc etc. The 14th Century logician, William of

    Ockham, stated the principle of [I]lex parsimoniae[/I]; the simplest solution

    is probably the best solution. ?

    Chris
    ×

    Success!

    Help @W8_4me spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...