|
java problem
|
Logged in as: Guest
|
Name: | |
|

Jimmy Crabb
Posts: 203
Member since: 10/15/2002
From: South Africa

|
java problem
|
|
|
On my minerals and crystals website at http://www.absolutequartzcrystals.com, I am trying to add a short video clip of each item along with the pictures. I am using a program which converts .wmv to .flv as well as generating the java code to call and play the flash video like this: <script type="text/javascript" src="swfobject.js"></script> <div id="index"> Upgrade your Flash Player to version 8 to view this video! (<a href=http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player.exe target=_blank>Click here for the download</a>)<br><br><a href="http://www.videowebwizard.com">Add streaming video to your website</a> </div> <script type="text/javascript"> var so = new SWFObject("Midnight.swf?path=test2.FLV&buffersize=0&startauto=false&redirect=", "index", "340", "300", "8", "#ffffff"); so.write("index");</script> <!--LINK--> It works great when I cut and paste the code directly into the page but I need to call the vids dynamically as there is a different on for each item, so I hard code the first bit of the java into my page, and then pull the second bit (everything after the </div>) from my database like so <%=FP_FieldVal(fp_rs,"Code1")%> The trouble is that when I do this, instead of executing the code, it displays it on the site as text (see http://www.absolutequartzcrystals.com/crystals-members/crystalsale.asp?Name='Pair+Of+Mahogany+Goblets%2E%2E'&ProdID=1162 for an example. How do I make the java work instead of displaying as text?
_____________________________
Any technology distinguishable from magic is insufficiently advanced. http://www.absolutequartzcrystals.com
|
|
|
|
Report Abuse |
Date: 8/7/2008 1:55:22 AM
 |
|

TexasWebDevelopers
Posts: 7038
Member since: 9/24/2002
From: USA

|
RE: java problem (in reply to Jimmy Crabb)
|
|
|
I've done this a few different ways in a Blog application we wrote. Both examples can be called to the page something like this: <%=Go_StripHTML(FP_FieldVal(fp_rs,"Code1"))%> OK I am getting come code display errors here in the strOutput bits---let me see if I can make this work... ----- <script language="VBScript" type="text/vbscript" runat="server"> function Go_StripHTML(strtext) on error resume next arysplit=split(strtext,"<") if len(arysplit(0))>0 then j=1 else j=0 for i=j to ubound(arysplit) if instr(arysplit(i),">") then arysplit(i)=mid(arysplit(i),instr(arysplit(i),">")+1) else arysplit(i)="<" & arysplit(i) end if next strOutput = join(arysplit, "") strOutput = mid(strOutput, 2-j) strOutput = replace(strOutput,""",""") strOutput = replace(strOutput,"&","&") strOutput = replace(strOutput,"<","<") strOutput = replace(strOutput,">",">") Go_StripHTML = strOutput End Function </script> <% function Go_StripHTML(strtext) on error resume next 'Strips the HTML tags from strHTML Dim objRegExp, strOutput Set objRegExp = New Regexp objRegExp.IgnoreCase = True objRegExp.Global = True objRegExp.Pattern = "<(.|\n)+?>" 'Replace all HTML tag matches with the empty string strOutput = objRegExp.Replace(strtext, "") Set objRegExp = Nothing strOutput = replace(strOutput,""",""") strOutput = replace(strOutput,"&","&") strOutput = replace(strOutput,"<","<") strOutput = replace(strOutput,">",">") Go_StripHTML = strOutput End Function %> ----------- So--here is an image (below) with the correct form of the code and then the (incorrect, above) code posted as text that you can copy/paste and then change to reflect the correct image. This bb won't let me the correct code post as [ code ] or text.
Attachment (1)
< Message edited by TexasWebDevelopers -- 8/7/2008 10:13:49 AM >
_____________________________
FrontPageTools.com:Templates, Tools and Training support this forum
|
|
|
|
Report Abuse |
Date: 8/7/2008 9:51:08 AM
 |
|

Jimmy Crabb
Posts: 203
Member since: 10/15/2002
From: South Africa

|
RE: java problem (in reply to Jimmy Crabb)
|
|
|
Thanks Tex, but I already got it sorted - Frontpage to the rescue When adding database records to a page with FP it creates a long line of code rather than simply <%=FP_FieldVal(fp_rs,"Code1")%> ... something like this: <!--webbot bot="DatabaseResultColumn" s-columnnames="ProdID,SKU,Manuf,Name,Price,Category,Description,Gif,Inventory,Weight,Size,Thumbnail,Location,Size2,Picture2,blah, blah blah blah.... - I used the FP method to insert the database values and then right click on the link in the design view >> Database Column Value Properties >> Column Contains HTML and voila....it's working
_____________________________
Any technology distinguishable from magic is insufficiently advanced. http://www.absolutequartzcrystals.com
|
|
|
|
Report Abuse |
Date: 8/8/2008 1:14:46 AM
 |
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|