http://www.w3schools.com/jsref/met_table_insertrow.asp

This is simplest explaination one need to insert row/cell to a table.

Can you put your code so that we can find what is wrong in your try?

function getGroups(yourRawArray) {
    var group1 = [];
    var group2 = [];

    for(var i = 0; i < yourRawArray.length; i++) {
        var obj = yourRawArray[i];
        if(obj['2'] == '0') group1.push(obj);
        if(obj['2'] == '1') group2.push(obj);
    }

    return {'group1': group1, 'group2': group2};
}

function getGreatest(groupArray) {
    // To get Greatest you just need to sort the 2 group arrays and pick the first item
    return (groupArray.sort(function(a, b) { return a['2'] > b.['2']; } ))[0];
}

// Get 2 groups
var groups = getGroups(yourRawArray);

// Get Greatest
var greatestOfGroup1 = getGreatest(groups.group1);
var greatestOfGroup2 = getGreatest(groups.group2);

You haven't handled ajax error method. I am sure it will be going there.

Thanks!

Hi pritaeas - Thanks for the reply.I am looking for someting which google do to compress the html code(If you see the source code of www.google.com). I was wondering if there is any built in feature in MVC4, razor engine to do this.

Thanks!

Hi All,
How can we enable HTML code compression in .Net? Is there anything we need to do in web.config or external tool is needed?

Thanks!

$(".second-form").clone().prependTo("#frmMain");
$("#frmMain").remove();

Use jQuery to make your life easy!

First clone the inner form and add it above the outer form. Them remove the outer form.

Thanks!

function getParam(paramName) {
    var url = window.location;
    var params = url.substring(url.indexOf("?") + 1 , url.length).split("&");
    for(var i = 0; i < params.length; i++) {
        var param = params[i].split("=");
        if(param[0] == paramName) return param[1];
    }

    return null;
}

var userName = getParam("name");

$("#welcome").html("Hey " + userName);

Hope this will work :)

Thanks!

var beeped = false;
function checkResponseStatus(){

    $.getJSON("requestrespond.php",  

    function(data)
    {   
        ...
        ...
        ...
        if (respond_status == 1) {  //request has been made
            document.getElementById("responseStatus").disabled = false;
            document.getElementById("responseStatus").innerHTML = "Request Sent on "+ respond_date + " <br /> Time: " + respond_time + "<br /> " + "Click Here To Respond";

            if(!beeped) {
                navigator.notification.beep(1);
                beeped = true;
            }   
        }

        ...
        ...
        ...

    }

Thanks!

height of an relative positoned element in % is caclulated on the basis of its parents. You need to set height of parent. In case parent is body you can add following css to make your dive work:-

html,body{height: 100%;}

Thanks!

This is solved but here is the more clean method to pass argument(s) you should know:-

function abc(msg, msg1){
    alert(msg + " | " + msg1);
}

setTimeout(abc, 500, "Hello", " World")

Thanks!

Hi All,

I am in search for some good "Responsive web Designing" CSS frameworks. Kindly Suggest few.
I have gone through:- Bootstrap, Foundation and Amazium. All seems same to me.

Line 6 have typo, it should be:-

[code=javascript]
$('input[name="button1"]').click(function(){
[/code]

Just before sending ajax request, use your modalpopup to show the loading gif image. Something like this:-
[code=javascript]
modalPopUp.html("<img src='loading.gif'/>");
ajax.send(onSuccess);

function onSuccess(ajaxResponse) {
// Data recieved from ajax, update popup
modalPopUp.html(data);
}
[/code]

Hope this will give you some idea.

Ok let say you have input fields named as 'firstname', 'lastname' and 'age'.
Now as you said you have form element, lets call it 'formEl'. Then you can get values of above input fields values in following way:-

[code=javascript]
var fName = formEl.firstName.value;
var lName = formEl.lastName.value;
var age = formEl.age.value;
[/code]

Now as all the values are captured you can show it in container element the we have created in step 0.

[code=html]
<form id="myForm">
<input type="text" name="firstname"/>
<input type="text" name="lastname"/>
<input type="text" name="age"/>

    <input type="button" onclick="showValues();" value="Show values"/>
</form>
<div id="container">Form values will be shown here...</div>

<script type="text/javascript">
function showValues() {
var formEl = document.getElementById("myForm"); // Get Form element
var container = document.getElementById("container"); // Get Container element
// Now get form inputs value
var fName = formEl.firstName.value;
var lName = formEl.lastName.value;
var age = formEl.age.value;

        // Now create a string with form inputs value
        var str = "";
        str += "First Name : " + fName + "\n";
        str += "Last Name : " + lName + "\n";
        str += "Age : " + age + "\n";

        // Now show above string in the container 
        container.innerHTML = str;
    }

</script>

[/code]

This is a complete example. If you find any bug then resolve them.

  1. Create a container html element like <div id="content"></div>
  2. Get the form element. There are many ways, please refer
  3. With form element get input elements
  4. With input elements get there values and show them on some container element

Hope I have help you

In javascript code line 7, you are always sending search string as 'searchString'. Probably you should try this:-

[code=javascript]
var data = {'search' : searchString , 'category' : category};
[/code]

There was an error while checking on Chrome as on FireFox its messe up, The error was at index.php:139

[COLOR="Red"]Uncaught TypeError: Cannot read property 'value' of null[/COLOR]

Resolve this.

KPheasey commented: Found the problem +1

Try using FireFox's firebug to find the error.

Well I noticed on thing at line 134, where you are creating window html, you have added 'style' attributes like :-

document.write('<div id="'+n+'_wnd'+'" class="WINDOW" [COLOR="Red"][B]style="top:'+(y-22)+';left:'+x+';width:'+w+';height:'+h+';"[/B][/COLOR]></div>');

you have not added [COLOR="red"]'px'[/COLOR] for 'top', 'left' etc properties. The right way is:-

[code=html]
<div style="left: 20px; top: 20px; height: 200px; width: 300px">Test</div>
[/code]
Try adding 'px'.

There is a dirty way by using cookies. In pop-up window write user choice in cookies before closing it and then read back the cookies in first page. This is not a clean method.

You have to use Ajax to bring the content of popup window on the same page and then you can do what ever you like.

Here is updated version also works on FireFox. Use this ignore previous one. Sorry I missed updated version.

[code=html]
<html>
<head>
<title>Analog clock Css3</title>

    <style>
        #clock {
            position: absolute;
            width: 600px;
            height:600px;
            top: 100px;
            left: 300px;
        }
        .aclock_container {
            position: absolute;
            width: 98%;
            height: 98%;
            top: 1%;
            left: 1%;           
        }
        .aclock_clock_container {
            position: absolute;
            width: 100%;
            height: 100%;
            top: -10px;
            left: -10px;
            -webkit-border-radius: 50%;
            -moz-border-radius: 50%;
            border: 10px solid blue;
        }
        .aclock_dial {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0%;
            left: 0%;
            background: -moz-linear-gradient(left, rgba(30,87,153,1) 0%, rgba(133,247,239,0) 100%); /* FF3.6+ */
            background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(30,87,153,1)), color-stop(100%,rgba(133,247,239,0))); /* Chrome,Safari4+ */
            background: -webkit-linear-gradient(left, rgba(30,87,153,1) 0%,rgba(133,247,239,0) 100%); /* Chrome10+,Safari5.1+ */
            background: -o-linear-gradient(left, rgba(30,87,153,1) 0%,rgba(133,247,239,0) 100%); /* Opera11.10+ */
            background: -ms-linear-gradient(left, rgba(30,87,153,1) 0%,rgba(133,247,239,0) 100%); /* IE10+ */
            filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#0085f7ef',GradientType=1 ); /* IE6-9 */
            background: linear-gradient(left, rgba(30,87,153,1) 0%,rgba(133,247,239,0) 100%); /* W3C */
            -webkit-border-radius: 50%;
            -moz-border-radius: 50%;
        }
        .aclock_small_mark {
            position: absolute;
            width: 1%;
            height: 2%;
            top: 0%;
            left: 49.5%;
            background: black;  
        }
        .aclock_big_mark {
            position: absolute;
            width: 2%;
            height: 3%;
            top: 0%;
            left: 49%;
            background: red;    
        }
        .aclock_hand_container {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0%;
            left: 0%;
        }
        .aclock_hour_hand {
            position: absolute;
            width: 3%;
            height: 35%;
            bottom: 45%;
            left: 48.5%;
            background: #222;
        }
        .aclock_minute_hand {
            position: absolute;
            width: 2%;
            height: 45%;
            bottom: 45%;
            left: 49%;
            background: #111;   
        }
        .aclock_second_hand {
            position: absolute;
            width: 1%;
            height: 55%;
            bottom: 40%;
            left: 49.5%;
            background: red;    
        }
        .aclock_milli_hand {
            position: absolute;
            width: 1%;
            height: 25%;
            bottom: 45%;
            left: 49.5%;
            background: red; ...

I have seen many beautiful clocks using images and and canvas and flash. So I thought of developing one with pure HTML,CSS3 and javascript, no images at all. This clock can be completely design using CSS.

A brief description of Javascript used:-

'AnalogClock' is the name of the class which creates a clock. You can simply create as many instance of the clock on page (keeping in mind the performance).
This how you can create a clock:-

  1. Include all the css in the page
  2. Then create a container for the clock on page
    [CODE=html]<div id="aclock"></div>[/CODE]
  3. Create an instance of 'AnalogClock' in javascript
    [CODE=javascript]new AnalogClock({parentId: 'aclock', milliSecond: true});[/CODE]
    Thats it!! You can refer to the snippet.

Hope you all will like it. Write me at [email]vivek_kumar_bt@yhaoo.co.in[/email]

Sorry you can't do it in javascript alone.

Hi Devinodaniel,

As Airshow said, this is not a complete solution. W are not here to do job but to help each other. We gave you approaches not solutions. Like in my snippet, there are still lot to do like handling other keys other than mac specific. try backspace.

You need to add more code to make it foolproof.

Try this:-

[code=html]
<html>
<head>
<script>
function doInsert(inp) {
var v = inp.value;
var l = v.length;
var maxLen = 17 // Length of mac string including ':'
if(l >= 2 && l < maxLen) {
var v1;
v1 = v;
/ Removing all ':' to calculate get actaul text /
while(!(v1.indexOf(":") < 0)) { // Better use RegEx
v1 = v1.replace(":", "")
}
/ Insert ':' after ever 2 chars /
if(v1.length%2 == 0) {
inp.value = v + ":";
}
}
}
</script>
</head>

<body>
    <input type="text" maxlength="17" onkeydown="doInsert(this);"/>
</body>

</html>
[/code]

Its sometimes good to reinvent wheel ... I just did :p

Use structure to copy at one go without looping.
Something like this:

[code=c++]
struct Phrase {
char phrase[50];
};

Phrase codePhrase, inputPhrase;

cout << "Please input your code without spaces: ";
cin >> inputPhrase.phrase;

// Now copy it to your codePhrase
codePhrase = inputPhrase;
[/code]

WaltP commented: Worthless. Doesn't answer any question asked. -4

[CODE=c++]

include <QtGui>

class MaskedLabel : public QLabel
{
protected:
void resizeEvent(QResizeEvent* event)
{
QLabel::resizeEvent(event);

    QPixmap pixmap(size());
    pixmap.fill(Qt::transparent);
    QPainter::setRedirected(this, &pixmap);
    QPaintEvent pe(rect());
    paintEvent(&pe);
    QPainter::restoreRedirected(this);
    setMask(pixmap.mask());
}

};

int main(int argc, char argv[])
{
QApplication a(argc, argv);
QLabel
label = new MaskedLabel();
label->setText("Qt Centre!");
QFont font = label->font();
font.setPointSize(72);
label->setFont(font);
label->show();
return a.exec();
}
[/CODE]

Hi,

I tired this approach to create Picture In Picture(PIP) window on QWebView widget. And my goal is to create hole on QwebView so that video playing in the background is visible through PIP window.

When I first create this Masked Label its showing me the video playing in background, all is good at this point. But when I try to change the height/width of the Masked Label using setGeometry() method of QLabel, its is not showing me transparent window. But when I only(not changing the height/widht) move it around on the screen using same setGeometry(), it just work fine.

Any idea OR approach to achieve my goals.

Thanks.

Thanks all

Thanks!!

While searching for css3 gradient, I got this pretty cool web tool:

[url]http://www.colorzilla.com/gradient-editor/[/url]

[code=javascript]
var clickCount = 0;
document.onclick = function() {clickCount++};

doucment.onunload = function(){alert("No. of clicks = " + clickCount);};
[/code]

Eclipse, aptana both are free and good