Opened 10 years ago
Closed 10 years ago
#5793 closed defect (bug) (no action required)
Ajax drop-down in Activity Stream and Members Directory won't work on mobile?
Reported by: | rossagrant | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Activity | Keywords: | |
Cc: | shane@… |
Description
Hi guys,
I've tested this on a few installs with no plugins active and in BP-Default.
When using the ajax activity stream drop-down or the members directory drop-down to change views of stuff on mobile, it just doesn't work.
You can see the browser processing something, but no change in data is actually displayed.
I've tested on iPhone and iPad which both act the same.
I don't have access to any other mobile devices.
Could someone confirm they see this too?
Thanks.
Change History (7)
#2
@
10 years ago
I've figured this out Shane but I'm not sure if it's been my WP setup or whether WP is trying to do stuff a little differently where Apple Safari struggles.
Debugging this on my iPhone gave me this error:
‘XMLHttpRequest cannot load http://www.staging.mysite.com/wp-admin/admin-ajax.php.
Origin http://staging.mysite.com is not allowed by Access-Control-Allow-Origin.’
So it was to do with a mix of www. and non www. prefixes.
To allow this kind of cross site scripting securely you can add this to your htaccess file:
Header set Access-Control-Allow-Origin http://staging.mysite.com
And everything works just fine.
Any ideas if this would be caused by my initial WP install – even though from what I can tell it’s set to www.
My live site doesn’t have any issues – so maybe it just was my staging site’s setup.
I guess we need to figure if wp-admin/ajax.php is trying to mix the two url paths, or whether this was due to my initial setup.
I'm not great with php though, so someone with a deeper knowledge might be best to take a look.
Hope this helps.
#3
@
10 years ago
Just for the record - Chrome on iPhone also had this initial problem.
They don't do Firefox for iPhone, so can't test any other decent ones.
#4
@
10 years ago
Thanks for the info Ross.
So this isn't a bug.
But the info is very useful - even more useful as a codex article.
Would you like to write such an article ?
https://codex.buddypress.org/wp-admin/post-new.php?post_type=page
And then post the article link here?
#5
@
10 years ago
No worries Shane!
I can vaguely recollect that I did indeed change those WP general settings URL's to have a www.
Reverting them to have no www. actually solves my initial problem, so I have removed the htaccess edits.
Just so I can understand how this mix up can happen - could you explain what DIDN'T change when I added those www. prefixes in the settings page.
Why was my install on the ajax script still looking for a no www. url?
I am more than happy to write this up in codex, I just want to understand it a litle better.
Thanks :)
#6
@
10 years ago
I'm not sure what happened, but it is quite easy to inadvertently 'break' access to wp-admin/ajax.php. Usually there are no obvious errors, but ajax calls no longer work.
I also don't understand why WP puts the ajax.php in admin.
Anyhow, a codex page on this subject doesn't need to be complete or authoritative.
More like... if you're having these symptoms, you should check this and that, and try these fixes. Then the page can grow as other members add scenarios.
I've had clients say the same thing, but I don't have any Apple products.
jquery - ajax issues specific to Safari ( and not necessarily WP ) seem common via google.
Are you using Safari on both devices?
And you say Safari on desktop works as expected?
Can you try a different browser on those apple mobile devices and report back?