473,671 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript Prototype Background issue...

4 New Member
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="backgrou nd-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
4 2476
pbmods
5,821 Recognized Expert Expert
Heya, Nahum. Welcome to TSDN!

When you run the show() function, what does ht evaluate to?
Aug 16 '07 #2
Nahum Silva
4 New Member
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
5,821 Recognized Expert Expert
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
Nahum Silva
4 New Member
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

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

Similar topics

10
2516
by: vinu | last post by:
I have a javascript file named select.js. This is a file which is use to pop up a calendar, when clicked on a calendar icon in an ASP file. have a close button in the calendar. When i click on the button, th calendar is not closing. here is the select.js file x999NS4compatible = (document.layers); var x999IE4compatible = (document.all); var x999dayabbs = ;
19
1812
by: tnhoe | last post by:
Hi, any excel like grid javascript which is stable and fast to load thousand of rows data ? can it have F2 function to popup another window ? can validate cell value when cursor move away that cell ? Either free or low developer license with royalty-free distributed with web application. TQ. Regards Hoe tnhoe@pc.jaring.my
3
4747
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
41
4932
by: Rene Nyffenegger | last post by:
Hello everyone. I am not fluent in JavaScript, so I might overlook the obvious. But in all other programming languages that I know and that have associative arrays, or hashes, the elements in the hash are alphabetically sorted if the key happens to be alpha numeric. Which I believe makes sense because it allows for fast lookup of a key.
7
1804
by: Wm.M.Thompson | last post by:
For a computer programmer JavaScript is not difficult. It is pretty easy to look at some code for the first time and figure out what is going on. This is especially true if you have gratuated from an old-fashioned top-down programmer to an object oriented computer programmer. I mean, most Javascript has a look where things are sectioned off into functions. This is pretty much true until one gets into DHTML and a very cool
15
2256
by: Phlip | last post by:
Javascripters: I have an outer page and an inner iframe. The outer page calculates some javascript, and wants the inner frame to run it. The inner frame should hit a page on the same (private) web server, so this is not a cross-site scripting attack. But I would prefer not to taint the target page with any extra logic to do this. (I will if I must.) The calling page has these elements:
18
1904
by: Tom Cole | last post by:
I'm working on a small Ajax request library to simplify some tasks that I will be taking on shortly. For the most part everything works fine, however I seem to have some issues when running two requests at the same time. The first one stops execution as the second continues. If I place either an alert between the two requests or run the second through a setTimeout of only 1 millisecond, they both work. You can see a working example here:...
1
3842
by: wkerplunk | last post by:
Below is what I have build with several different languages. It works great but I need help, I am stuck. When you click on an item in the dropdown autocomplete div it does a mousedown function and send the item number to the xmlHttp and works awesome. Now I need to add an apply button next to it. so they can type in the complete number then hit apply and it does the same function. I cant get it to work with the script I have. The image...
4
1972
by: Arun | last post by:
I came across a message sometime back in 2002. Here's a link: http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/f10e3748f6f260c5/b0b1ac5840e445e5?lnk=gst&q=color+picker#b0b1ac5840e445e5. The author tries to build a colour picker from scratch but his overuse of <tdtags puts me off the solution. Here is something I just created. It uses prototype, just because it makes life easier for me. .... <head> <script...
0
8485
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8403
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8828
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8605
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8677
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7446
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6238
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.