JS mobile
3 posters
Page 1 of 1
JS mobile
Forum version : #phpB3
Concerned browser(s) : mobile devices
Who the problem concerns : All members
Forum link : http://testyforum.forumpolish.com/forum
Helo. I have the problem/question. How can I use the JS script on mobile devices ? I would like that people using mobile devices sees this script:
The script works when I use desktop browser, but when I use mobile devices is not active. Is that possible ? Sorry for my english
Concerned browser(s) : mobile devices
Who the problem concerns : All members
Forum link : http://testyforum.forumpolish.com/forum
Helo. I have the problem/question. How can I use the JS script on mobile devices ? I would like that people using mobile devices sees this script:
- Code:
$(function(){
$('.post .postbody').each(function(){ /*SPACE CAISNO */
var str = $(this).html();
var newStr = str.replace(/forum/gi, "<a href='http://help.forumotion.com/'>forum</a>");
$(this).html(newStr);
});
});
The script works when I use desktop browser, but when I use mobile devices is not active. Is that possible ? Sorry for my english

Last edited by testyforum on January 2nd 2018, 10:11 pm; edited 1 time in total
Re: JS mobile
What does this JS do?


Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: JS mobile
Hello,
Try my code, i don't know work...
Try my code, i don't know work...
- Code:
var isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
if (isMobile) {
$(function(){
$('.post .postbody').each(function(){ /*SPACE CAISNO */
var str = $(this).html();
var newStr = str.replace(/forum/gi, "<a href='http://help.forumotion.com/'>forum</a>");
$(this).html(newStr);
});
});
}
Re: JS mobile
@SLGray if you write "forum" you receive
@Apollo 2.0 not working
- Code:
<a href='http://help.forumotion.com/'>forum</a>
@Apollo 2.0 not working

Re: JS mobile
Hy, try this code, for me work.
- Code:
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
$(function(){
$('.post-section .post-content').each(function(){ /*SPACE CAISNO */
var str = $(this).html();
var newStr = str.replace(/forum/gi, "<a href='http://help.forumotion.com/'>forum</a>");
$(this).html(newStr);
});
});
}
Re: JS mobile
Problem solved & topic archived.
|


Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

» Huge Mobile Blunder - requesting mobile expert to help with java script and AVAC chat.
» New update : New design for forums Administration Panel + Classified ads mobile pages + mobile banner
» Mobile Registration page / New Mobile Theme Version
» [Only Topic]Ads appearing on mobile browsers/mobile phones
» Mobile
» New update : New design for forums Administration Panel + Classified ads mobile pages + mobile banner
» Mobile Registration page / New Mobile Theme Version
» [Only Topic]Ads appearing on mobile browsers/mobile phones
» Mobile
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum