By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,749 Members | 1,627 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,749 IT Pros & Developers. It's quick & easy.

Javascript Prototype Background issue...

P: 4
Hi everybody, Im a new user, my question is simple and dont really a pain in the ass, Im using prototype templeates for my project, the problem is when I tried to put an background-image throw this way, the background just dont show, and if you write it in the in-line way I mean style="background-image blalba" works fine... my code go something like this... If some one had the same problem or Issue bug etc... please post something... regards nahum...
Expand|Select|Wrap|Line Numbers
  1.     show:function()
  2.     {
  3.         var viewTemplate = library.templatesHash["template"];                
  4.         var ht = template2.evaluate( {viewTemplate:viewTemplate} );
  5.         workArea.update( ht );
  6.     }
  7.  
and my file.css is something like this...
Expand|Select|Wrap|Line Numbers
  1. td.td8{background-image:url(img/formas/img_background.gif); background-repeat:no-repeat; width:283px;border-right:1px solid #CCCCCC; border-bottom:1px solid #CCCCCC; vertical-align:top;}
  2.  
just for the record when put the same css in inline works fine....
Aug 16 '07 #1
Share this Question
Share on Google+
4 Replies


pbmods
Expert 5K+
P: 5,821
Heya, Nahum. Welcome to TSDN!

When you run the show() function, what does ht evaluate to?
Aug 16 '07 #2

P: 4
Heya, Nahum. Welcome to TSDN!

When you run the show() function, what does ht evaluate to?

Well actually what evaluate is the html file where I have define all my structure my form... is look like this...
Expand|Select|Wrap|Line Numbers
  1. <td> 
  2.    <div id="p1ViewDatosPago">#{html}</div>
  3. </td>
where #{html} will be replace for the source html or just the text I put in it... in this case Im evaluating a html source... and in this html exist a class name for example td1 where I writed this...
Expand|Select|Wrap|Line Numbers
  1. td.td10{vertical-align:top; width:268px; border-bottom:1px solid #CCCCCC; border-right:1px solid #CCCCCC;background-image:url(img/formas/img_background_facturacion.gif); background-repeat:no-repeat;}
but if I write something like this inside the file that has been evaluated...
Expand|Select|Wrap|Line Numbers
  1.               <td class="td10" style="background-image:url(img/formas/img_background_facturacion.gif); background-repeat:no-repeat;">
  2.                 <div id="p1ViewDatosFacturacion">&nbsp;</div></td>
  3.  
works!!!!! fine, but insteed I write something like this...
Expand|Select|Wrap|Line Numbers
  1.               <td class="td10">
  2.                 <div id="p1ViewDatosFacturacion">&nbsp;</div></td>
  3.  
where I declared the just the class the background dissapear... is somenthing strange I dont know exactly if is a kind a bug of prototype or is just me doing the thing wrong lol... thanx for the answer and the interest...
Aug 16 '07 #3

pbmods
Expert 5K+
P: 5,821
Heya, Nahum.

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

If you already have a .css file, why not just implement it with a link tag?

E.g.,
Expand|Select|Wrap|Line Numbers
  1. <link rel="stylesheet" type="text/css" href="... /file.css" />
  2.  
Aug 16 '07 #4

P: 4
ok.. I will do it the next time... Im actually Im working with the link tag... I think is a kind of bug in prototype I will post this issue in prototype bug report.. to see if is really a bug... anyway.. I really thanx for all this replies... and If some else know or have the same issue will be great to hear about it... :) If somebody in prototype answer me... I bring the answer here... thanks alot...
Aug 16 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.