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
https://forums.phpfreaks.com/topic/122528-new-to-js/#findComment-633290
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
https://forums.phpfreaks.com/topic/122528-new-to-js/#findComment-633696
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.