• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird behaviour - image dissappears

#1
[eluser]The Mask[/eluser]
I have an 'About' page that is called by an 'About' controller...

function index()
{
$this->load->view( 'about_view' );
}

This works fine when called as: http://www.mysite.com/about

However, if I change my controller to include a method that does exactly the same, an image at the top of the page dissappears.

i.e.
http://www.mysite.com/about/test

and in my controller...
function test()
{
$this->load->view( 'about_view' );
}

So the same view is being loaded but an image is not shown. Any ideas, it's driving me nuts!
I have stripped everything out of the controller and view to leave basically what is above.

#2
[eluser]Bramme[/eluser]
what's the path of your image?

there's a huge difference between <img src="images/blah.gif"> or <img src="/images/blah.gif">

I'm guessing you've got smth like the first and you need smth like the second. (it happened to me on the current site i'm doing)

#3
[eluser]The Mask[/eluser]
All sorted.
Thanks very much!

#4
[eluser]extra_rice[/eluser]
[quote author="The Mask" date="1215630994"]All sorted.
Thanks very much![/quote]

so how did you solve it?

#5
[eluser]Dagobert Renouf[/eluser]
hi guys, I have a similar probleme here.

When I request my page with "index.php" image show up.
But if I just drop the index.php from the url they won't show up, wtf ?

The path is '../files/' and I tried a lot of different ones.
I'm trying to target : "www/codeIgniter/files"

#6
[eluser]The Mask[/eluser]
My image src was set to "images/xxx.jpg", changed it to "/images/xxx.jpg" and it works fine now. It was aa simple as that.

#7
[eluser]Dagobert Renouf[/eluser]
thank you themask :

To avoid the bug I need to do this : /codeigniter/images/xxx.jpg I don't know why this differs from you but whatever it works.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.