Jump to content

new to js


sstangle73

Recommended Posts

its called through ajax. i suppose that is the problem. any idea how to make it work.

It doesn't matter what it's called through. In JavaScript:

border='2px solid #FF0000';

You can't use that syntax.

 

http://www.w3schools.com/css/css_border.asp

Use that site to specify each border values separately with JavaScript. That's the only way with JavaScript alone.

 

The other way is to make a CSS class or ID with that value and just add the class using JavaScript.

Link to comment
Share on other sites

its called through ajax. i suppose that is the problem. any idea how to make it work.

It doesn't matter what it's called through. In JavaScript:

border='2px solid #FF0000';

You can't use that syntax.

 

http://www.w3schools.com/css/css_border.asp

Use that site to specify each border values separately with JavaScript. That's the only way with JavaScript alone.

 

The other way is to make a CSS class or ID with that value and just add the class using JavaScript.

 

sure you can...it's perfectly fine to add a border with that syntax. the probably probably has to do with your AJAX. the javascript won't evaluate when you load it with standard AJAX methods. you have to parse the JS out of the contents returned and eval() it. i would use a JS library like jQuery or Prototype, as they will do this for you automatically.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.