Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeigniter with jQuery Mobile sometimes returns wrong base_url()
    primarykey
    data
    text
    <p>Good day, fellow coders!</p> <p>I am currently working on a mobile version of a website. We are initially using Codeigniter as framework, but as for the mobile version, we are asked also to use a bought Mobile Template package that uses jQuery Mobile.</p> <p>PROBLEM:</p> <p>By going to other pages (clicking on links via anchor tags, buttons, ajax redirect, etc) errors RANDOMLY occur on the following:</p> <ul> <li>broken links of images</li> <li>broken href links on anchor tags</li> <li>going to a wrong controller (page not found)</li> </ul> <p>I have noticed that even if I add in on every link it goes, the link changes to the current full URL..</p> <p>EXAMPLE:</p> <p>I am in</p> <pre><code>http://localhost/m.mysite/dashboard </code></pre> <p>and from that page I am in, if I click on</p> <pre><code>&lt;a href="&lt;?php echo base_url();?&gt;home/login"&gt; </code></pre> <p>the URL it will go to will be</p> <pre><code>http://localhost/m.mysite/dashboardhome/login &lt;!-- ERROR --&gt; </code></pre> <p>but if I refresh that page again, I will successfully see no broken links</p> <pre><code>http://localhost/m.mysite/home/login &lt;!-- CORRECT --&gt; </code></pre> <p>If I refresh the site, errors will be gone. Is this because jQuery mobile only do haschange and not refreshing each page?</p> <p>How come it's like this even if I added <code>&lt;?php echo base_url(); ?&gt;</code></p> <p>In the <code>application/config/config.php</code>, I have also made sure that I did not miss to indicate my base url as <code>http://localhost/m.mysite/</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload