Web Building Techniques

KPZ

Well-known member
  • Apr 15, 2011
    17,331
    1,622
    113
    where I wanna be
    JavaScript

    View attachment 41942View attachment 41943

    answer plzzzz :):)

    a,b ona naa

    Answer for (C)

    (i) & (ii)


    Code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Word And Length Count</title>
    <script src="calculateWordsandlength.js"></script>
    </head>
    
    <body>
    <table width="500" border="0">
        <tr>
          <td width="170"><label>Insert Your Sentence</label></td>
          <td width="160"><input name="sentence" id="sentence" type="text" size="50" /></td>
        </tr>
        <tr>
          <td></td>
          <td><input type="button" id="sentbtn" value="Calculate Words" onclick="calculateWordsandlength()"/></td>
        </tr>
      
    	<tr>
    		<td><label><strong>Number of words</strong></label></td>
    		<td><label id="status1"> </label></td>
    	</tr>
    	<tr>
    		<td><label><strong>Words			</strong></label></td>
    		<td><label id="status2"> </label></td>
    	</tr>
        </table>
    </body>
    </html>

    (iii) & (iv)

    Code:
    function calculateWordsandlength(){
    
    	var sentence = document.getElementById('sentence').value;
    	sentence = sentence.replace(/(^\s*)|(\s*$)/gi,"");
    	sentence = sentence.replace(/[ ]{2,}/gi," ");
    	
    	var letters = /[A-Za-z]/;  
    	
          if(sentence.match(letters))  
          {  
    	  	
         	var num = sentence.split(' ').length;
    	  	document.getElementById('status1').innerHTML = num;
    		
    		var wordArray = sentence.split(" ");
    		for(var word in wordArray){
    				document.getElementById('status2').innerHTML += (wordArray[word])+",";			
    			}
    		return true; 
          }  
          else  
          {  
          	alert('Please insert a valid sentence');  
          	return false;  
          }
    }

    මේකෙදි මචන් මිට වඩා වෙනස් උත්තර තියෙන්න පුළුවන්. මේ මම හදපු විදිහ.
     
    • Like
    Reactions: Ritash9001

    KPZ

    Well-known member
  • Apr 15, 2011
    17,331
    1,622
    113
    where I wanna be
    මචන්ලා මම xampp server එක දැම්ම ඒක වඩා කලේ නැහැනේ. ඊට පස්සේ wamp server එක දැම්මා. ඒක වඩා කලෙත් නැහැ. :(
    පස්සේ මම machine එක format කලා. අද තමයි වැඩ ඉවර වුනේ. :cool:
     

    hansa1018

    Member
    Sep 9, 2008
    13,509
    1,621
    0
    Colombo
    මචන්ලා මම xampp server එක දැම්ම ඒක වඩා කලේ නැහැනේ. ඊට පස්සේ wamp server එක දැම්මා. ඒක වඩා කලෙත් නැහැ. :(
    පස්සේ මම machine එක format කලා. අද තමයි වැඩ ඉවර වුනේ. :cool:

    elaazz..............
     

    KPZ

    Well-known member
  • Apr 15, 2011
    17,331
    1,622
    113
    where I wanna be
    HTML Primary Elements

    Web Page එකක් තුලදී තමන්ගේ ඉලක්කය නිසි ආකාරව සම්පුර්ණ කරගැනීමට නම් HTML main elements ගැන අවබෝදයක් තිබීම අවශ්‍යයි. තමන් ගනුදෙනු කරන web document එක නිසි ආකාරව වැටහ ගැනීමටත් , තමාගේ web එක search engine friendly ලෙසත් සාදා ගැනීමටත් මේ අවබෝදය උපකාරී වෙනවා.

    මෙය පිටුපස HTML elements(HTML tag sets) ගොඩක් තියෙනවා. ඒත් නියමාකාර web page එකක සැකිල්ල සාදා ගැනීමට අවශ්‍ය මුලික elements ගැන මුලින් අවධානය යොමු කරමු.


    මේවයින් ගොඩක් කලින් දැම්මා. ඒත් වැඩි හොදට ආයෙත් දානවා.


    <!DOCTYPE> -
    Document type declaration. මේ tag එක communicate කරන්නේ validators, browsers වගේ software එක්කයි. ඒ software web page එක access කරද්දී ඒවට දැනුම් දීමක් කරනවා මේ HTML page එකක් කියන එක.

    <html> -
    HTML page එකේ අරඹය සහ අවසානය සටහන් කරන්නෙ මෙම tag එකෙන්. අනෙකුත් සියළුම HTML tags ලියවෙන්නේ මේ tag (<html> </html>) දෙක ඇතුලෙයි.

    <head> -
    Document එකට අදාල metadata ඇතුලත් වන්නේ මේ tag 2 ඇතුලෙයි. <meta>, <title> elements සහ අපේ CSS, JavaScript වගේ දේවල් අපේ document එකට ඇතුලත් වෙන්නේ මේ tags 2 හරහායි.

    <meta> -
    මේ tags ප්‍රධාන වශයෙන් භාවිතා වෙන්නේ character setting, description සහ keywords වගේ දේවල් ඇතුල් කිරීමටයි. ඒ වගේම search engine robots සමග communicate කිරීමටත්, browser software එකට සමහර instructions දීමටත් මෙය භාවිතා වෙනවා.

    <title> -
    Page එකේ title එක ලබා දීමටත්, Search engine indexing bots සමග communicate කිරීමටත් මේ tags උපයෝගී වෙනව.

    <body> -
    Browser Software එකෙන් Display වෙන සියලුම දේවල් ලියවෙන්නේ මේ tag 2 අතරයි

    මේ සියලුම දේවල් එක Page එකක තියෙන විදිහ බලමු දැන්.

    HTML:
    <!DOCTYPE html> 
    <html>
    <head>
      <meta charset="UTF-8">
      <title>My Web Page</title>
    </head>
    <body>
      <h2>Welcome to my web page</h2>
    </body>
    </html>
    
     
    මේකේ charset="UTF-8" කියල තියෙන්නේ Web page එකේදී අපි පාවිච්චි කරන Character Setting එක.

    <h2></h2> කියල තියෙන්නේ Heading එකක්.
    Heading size 6ක් තියෙනවා.
    ඒවා
    <h1>
    <h2>
    <h3>
    <h4>
    <h5>
    <h6>

    ඔයාලට පුළුවන් මේ size 6 ම test කරලා බලන්න.

     
    Last edited:

    mjayanatha

    Well-known member
  • Jan 9, 2008
    28,378
    1,885
    113
    යන එන මං නැහැ
    මචන්ලා මම xampp server එක දැම්ම ඒක වඩා කලේ නැහැනේ. ඊට පස්සේ wamp server එක දැම්මා. ඒක වඩා කලෙත් නැහැ. :(
    පස්සේ මම machine එක format කලා. අද තමයි වැඩ ඉවර වුනේ. :cool:

    skype online thiyenawa nam server start wenne ne..port 80 use wena nisa..nathnam IIS run wenawanam eth wada karanne ne....skype exit karala...service wala IIS stop karala balanna.....nathnam wamp wala run wena ports change karanam wada...(meke waradi thiyenawa nam kiyanna :))
     

    KPZ

    Well-known member
  • Apr 15, 2011
    17,331
    1,622
    113
    where I wanna be
    <html>
    <head>
    <title> Hello elakiri world </title>
    </head>
    <body> <p align ="center"> This is my first HTML document </p> </body>
    </html>
    :D:D:D
    Ela Ela Macho
    Add More Macho
    Meke Patan Gaththa Ewa Kalekin Missing Wenawane
    Ehema Epa Apith Sup Eka Dennam Karagena Yamu
    elakiri මචන්
    1- Notepad,Wordpad,Dos ,Word --- මේක ඉතින් අපි කව්රුත් දන්නා එක නේ

    2- jEdit - මේක මම හාවිතා කරලා නැහැ
    JEdit_4.3_Fedora.png


    3 - GNU nano
    Nano_2.1.2-svn.png

    Download

    4- NEdit
    662px-NEdit-screenshot.png

    Download

    5- SciTE
    638px-Scite_%281%29.png


    Download
    6- TED Notepad
    TEDNPad.jpg

    Download

    7 - Notepad++
    screenshot4.png

    Download
    :yes::yes::yes:
    වැදගත් දෙයකි
    ඕන්න ඉතිං දන්න විදිහට මමත් සම්මාදන් වෙන්නං............
    අපේ KPZ සහෝදරයාගේ මහන්සියත් අගේකොට සලකනවා...............
    වැරදි ඇත්නම් නිවැරදි කරන ලෙසද ඉල්ලා සිටිනවා...........


    34pf5mo.jpg

    2nw31hv.jpg
    එළකිරි මචෝ.....
    මේක තමයි මම කිව්වේ. web ඉගෙනගන්න බලන් ඉන්න අයට උවමනා කරන හැම දේම එකම තැනකින්.

    ++
    අපි ආවා ;)
     

    KPZ

    Well-known member
  • Apr 15, 2011
    17,331
    1,622
    113
    where I wanna be
    skype online thiyenawa nam server start wenne ne..port 80 use wena nisa..nathnam IIS run wenawanam eth wada karanne ne....skype exit karala...service wala IIS stop karala balanna.....nathnam wamp wala run wena ports change karanam wada...(meke waradi thiyenawa nam kiyanna :))

    මම එහෙම බැලුව මචන්.... ඉස්සර skype තියෙද්දිත් වැඩ කලා බන්. මම machine එක format කරලා skype install කරන්නත් කලින් xampp දාලා බැලුව.ඒත් වැඩ නැහැ බං. wamp වැඩත් නැහැ. අන්තිමට EasyPHP දැම්මා. ඒක වැඩ මචන්. දැන් shape වැඩේ.
     

    mjayanatha

    Well-known member
  • Jan 9, 2008
    28,378
    1,885
    113
    යන එන මං නැහැ
    මම එහෙම බැලුව මචන්.... ඉස්සර skype තියෙද්දිත් වැඩ කලා බන්. මම machine එක format කරලා skype install කරන්නත් කලින් xampp දාලා බැලුව.ඒත් වැඩ නැහැ බං. wamp වැඩත් නැහැ. අන්තිමට EasyPHP දැම්මා. ඒක වැඩ මචන්. දැන් shape වැඩේ.

    ela machan wada nam....IIS eka check kalada ban..mage IIS stop kalama hari yanawa...:):):) anyway machan meka mega thread ekak karamu...
     

    KPZ

    Well-known member
  • Apr 15, 2011
    17,331
    1,622
    113
    where I wanna be
    HTML Elements List

    doctype
    comment
    a
    abbr
    address
    area
    article
    aside
    audio
    b
    base
    bdi
    bdo
    blockquote
    body
    br
    button
    canvas
    caption
    cite
    code
    col
    colgroup
    command
    datalist
    del
    details
    dfn
    div
    dl dt dd
    em
    embed
    fieldset
    figcaption
    figure
    footer
    form
    h1 h2 h3 h4 h5 h6
    head
    header
    hgroup
    hr
    html
    i
    iframe
    img
    input
    input button
    input checkbox
    input file
    input hidden
    input image
    input password
    input radio
    input reset
    input submit
    input text
    ins
    kbd
    keygen
    label
    legend
    li
    link
    map
    mark
    menu
    meta
    meter
    nav
    noscript
    object
    ol
    optgroup
    option
    output
    p
    param
    pre
    progress
    q
    rp rt ruby
    samp
    script
    section
    select
    small
    source
    span
    strong
    style
    sub sup
    summary
    table
    tbody
    td
    textarea
    tfoot
    th
    thead
    time
    title
    tr
    track
    u
    ul
    var
    video
     

    KPZ

    Well-known member
  • Apr 15, 2011
    17,331
    1,622
    113
    where I wanna be
    ela machan wada nam....IIS eka check kalada ban..mage IIS stop kalama hari yanawa...:):):) anyway machan meka mega thread ekak karamu...

    එළකිරි මචන්.... කට්ටිය දිගටම එනවනම් කම්මැලි නැතුව කරගෙන යන්න පුළුවන් මචන්.