小编use*_*625的帖子

改变tr背景颜色

我有这样的事情:

<tr id='<%=currentRow %>' onclick="SetBackgroundColor(this)" style="background-color:Yellow">
Run Code Online (Sandbox Code Playgroud)

当我点击一行我想改变它的背景颜色,我喜欢这样:

function SetBackgroundColor(rowId) 
{
     $(rowId).css("background-color", "#000000");
}
Run Code Online (Sandbox Code Playgroud)

但我不知道为什么它不起作用.有什么建议吗?

css jquery

17
推荐指数
3
解决办法
9万
查看次数

为c而不是c ++设置visual studio 2008编译器

我已经安装了visual studio 2008,我想用C语言创建一些简单的应用程序.我这样做是通过创建c ++控制台应用程序,但我希望编译器适用于C而不是C++.任何方式来实现这一点,或者我需要另一个编译器,如果我想处理C?

c c++ compiler-construction

1
推荐指数
1
解决办法
725
查看次数

如何在链表的开头插入节点?

有什么问题addAtBegin?该列表似乎是将新创建正确的后nodestart,但何时控制返回main,新的值不会被保存.

typedef struct node
{
    int data;
    struct node *link;
}node;

node* createList(int data)
{
    node *tempNode=(node*)malloc(sizeof(node));
    tempNode->data=data;
    tempNode->link=NULL;
    return tempNode;
}

void addAtBegin(node *start,int data)
{
    node *addedNode=(node *)malloc(sizeof(node));
    addedNode->data=data;
    addedNode->link=(start==NULL)?NULL:start;
    start=addedNode;
}

void displayNodes(node *start)
{
    node *startCopy=start;
    while(startCopy!=NULL)
    {
        printf("%d\t",startCopy->data);
        startCopy=startCopy->link;
    }
    printf("\n");
}

int main( )
{   
    node *start=createList(2);
    addAtBegin(start,1);
    displayNodes(start);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c linked-list data-structures

0
推荐指数
1
解决办法
2328
查看次数