Difference between setattr and object manipulation in python/django

This is more of a Python question. Python is very dynamic language. You can code things (classes) ahead of time, or Python allows you to create classes completely dynamically at run-time. Consider the following example of a simple vector class. You can create/code the class ahead of time like: class MyVector(object): x = 0 y … Read more

When to use setAttribute vs .attribute= in JavaScript?

From Javascript: The Definitive Guide, it clarifies things. It notes that HTMLElement objects of a HTML doc define JS properties that correspond to all standard HTML attributes. So you only need to use setAttribute for non-standard attributes. Example: node.className=”test”; // works node.frameborder=”0″; // doesn’t work – non standard attribute node.setAttribute(‘frameborder’, ‘0’); // works

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)