Invelos Forums->DVD Profiler: Layouts and Reports |
Page:
1 2 Previous Next
|
Creating layouts is not easy, when... |
|
|
|
Author |
Message |
Registered: March 13, 2007 | Reputation: | Posts: 3,321 |
| Posted: | | | | Quoting dvdoug: Quote: Unless your target audience includes people using Netscape 1 or IE2 I wouldn't bother with the <!-- and //-->. For HTML windows, the target audience is exclusively IE6/IE7. Excellent point. But in my defense, I simply copied the script block Ken had higher up in the page. | | | Get the CSVExport and Database Query plug-ins here. Create fake parent profiles to organize your collection. |
| Registered: March 13, 2007 | Posts: 55 |
| | Registered: March 13, 2007 | Posts: 670 |
| Posted: | | | | I've googled for this, but can't find the answer... I need to reference an image in JavaScript. Unfortunately, the link (obviously) contains backslashes, which need to be escaped in JavaScript. So I have done this: var Image = "$DPIMAGES.image.gif"; Image = Image.replace("\\","\\\\"); But Image ends up containing just "file://C:Documents and SettingsRanderApplication DataDVD ProfilerTempDesignImage.gif" - all the backslashes have gone... What to do? | | | The future is here. It's just not widely distributed yet. (William Gibson) |
| Registered: March 13, 2007 | Posts: 55 |
| Posted: | | | | Quoting Rander: Quote: I've googled for this, but can't find the answer...
I need to reference an image in JavaScript. Unfortunately, the link (obviously) contains backslashes, which need to be escaped in JavaScript. So I have done this:
var Image = "$DPIMAGES.image.gif"; Image = Image.replace("\\","\\\\");
But Image ends up containing just "file://C:Documents and SettingsRanderApplication DataDVD ProfilerTempDesignImage.gif" - all the backslashes have gone...
What to do? The backslashes need to be escaped before they become part of the javascript string - in the code you gave, the backslashes are removed by the JScript engine as it parses the first line of your script. Consequently, the second line isn't actually doing anything at all. I haven't played around with v3 much yet, so there might be a variable in HEADER_VARS that you can use (if not, then please add it Ken!). Otherwise you'll need to do something like this (untested). <img src="$DPIMAGES.image.gif" id="myImage" /> <script type="text/javascript"> var Image = document.getElementById("myImage"); //reference to <IMG> element var ImagePath = Image.getAttribute("src"); //the path to the image - which will be automatically escaped </script> | | | Doug
DougWeb.org - my personal site. TWSNBN.com Unofficial DVD Profiler Resource Centre - serving hundreds of users every month! DVD Profiler Wiki | | | Last edited: by dvdoug |
| Registered: March 13, 2007 | Posts: 96 |
| Posted: | | | | Quoting dvdoug: Quote:
I haven't played around with v3 much yet, so there might be a variable in HEADER_VARS that you can use (if not, then please add it Ken!). Otherwise you'll need to do something like this (untested).
As I had a similar problem, Ken added the following variables into the header section, which work fine for me. Quoting Ken Cole: Quote: 3.0.1 has the following new variables generated for the DP_HEADER_VARS tags: DP_ProgramLayoutName DP_ProgramDatabaseName DP_ProgramPathDatabase DP_ProgramPathImages DP_ProgramPathThumbnails DP_ProgramPathLayouts DP_ProgramPathReports DP_ProgramPathTemp DP_ProgramPathProgram
Additionally, I've doubled the \ chars in the paths. | | | Best regards,
Mithirandir
http://www.dvd-live.de
Download Mithirandir's Skin v1.54 from here!
Description / ReadMe's on Page 66! |
| Registered: May 15, 2007 | Posts: 7 |
| Posted: | | | | Sorry for this empty post. I used the wong thread and this is the reason why I deleted the post | | | Last edited: by ifbi98 |
|
|
Invelos Forums->DVD Profiler: Layouts and Reports |
Page:
1 2 Previous Next
|
|