visitor Posted November 21, 2009 Share Posted November 21, 2009 Hi, I've got pictures in a separate folder named photos. I'm trying to link it as follows... slsContents[0] = "<img src=\photos\"ip2803-017.jpg\" width=\"512px\" height=\"384px\">"; unfortunately this doesn't work. Does anybody know how this might work, please? Thanks visitor Quote Link to comment Share on other sites More sharing options...
haku Posted November 22, 2009 Share Posted November 22, 2009 Look at the HTML output of that code, and you will probably see right away. You have some error in your logic. Always remember, it's not the php input that renders, it's the HTML output. Quote Link to comment Share on other sites More sharing options...
nomadrw Posted November 22, 2009 Share Posted November 22, 2009 Hi, I've got pictures in a separate folder named photos. I'm trying to link it as follows... slsContents[0] = "<img src=\photos\"ip2803-017.jpg\" width=\"512px\" height=\"384px\">"; unfortunately this doesn't work. Does anybody know how this might work, please? Thanks visitor it should like like this slsContents[0] = "<img src=photos\"ip2803-017.jpg" width="512px" height="384px">" damon Quote Link to comment Share on other sites More sharing options...
haku Posted November 22, 2009 Share Posted November 22, 2009 That's still not right. Quote Link to comment Share on other sites More sharing options...
visitor Posted November 22, 2009 Author Share Posted November 22, 2009 Hi, Please see below what the developer wrote... //--------------------------------------------------------------------------------------------------------- // CONTENTS //--------------------------------------------------------------------------------------------------------- // Insert your contents here. Example: // // slsContents[0] = "This is the first page."; // slsContents[1] = "This is the second page."; // slsContents[2] = "Here's an image:<br><img src=\"path/to/image\">"; // ... // // - You can use HTML-tags. // - Escape all quotation marks inside your contents with a backslash (\"). // - Use tables or CSS to set a padding where needed. I tried this... but it still doesn't work (so you're right haku) slsContents[0] = "<img src=photos\"ip2803-017.jpg\" width=\"512px\" height=\"384px\">"; visitor Quote Link to comment Share on other sites More sharing options...
haku Posted November 22, 2009 Share Posted November 22, 2009 I'll repeat myself: Look at the HTML output of that code, and you will probably see right away. You have some error in your logic. Always remember, it's not the php input that renders, it's the HTML output. hint: <img src="path/to/file.jpg" /> Quote Link to comment Share on other sites More sharing options...
visitor Posted November 22, 2009 Author Share Posted November 22, 2009 Hm, according to the developer it should look like this... so is he wrong? // slsContents[2] = "Here's an image:<br><img src=\"path/to/image\">"; Quote Link to comment Share on other sites More sharing options...
haku Posted November 22, 2009 Share Posted November 22, 2009 No, he's right. You haven't followed his pattern. Quote Link to comment Share on other sites More sharing options...
visitor Posted November 22, 2009 Author Share Posted November 22, 2009 Hi haku, Yes, you're absolutely right! Now it works smoothly... slsContents[0] = "<img src=\"photos01/ip2803-017.jpg\" width=\"512px\" height=\"384px\">"; Thanks again for your help visitor Quote Link to comment Share on other sites More sharing options...
haku Posted November 23, 2009 Share Posted November 23, 2009 There you go mate! For future reference, you should check the html output. When you are looking at the page, choose 'view source', and you can see what is happening. You would have noticed the quotes in the middle of the path right away. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.