Is AJAX running for main pages? (Want an easy gallery)

Can't find the answer to your question in the Knowledge Base? Post it here and we'll answer it as quickly as possible.

Moderator: Help Desk Team

Forum rules
About
This board is designated for Smack Jeeves related support. If you have a question about using the site or the forums, you've come to the right place.

Before Posting
Please browse/search the Knowledge Base & FAQs Forum for the answer to your problem before posting. It contains an extremely helpful, organized list of common help topics.

Got a Bug?
Post it in Bugs & Glitches, not here.

Rules

    1) Use descriptive titles for your threads. Example: "How do I upload comics?" Do not use vague titles like, "question," "HELP! ANYBODY??"

    2) Describe your problem in detail. Explain exactly what is wrong. Post images, screen shots, links, code snippets - whatever is relevant. The better the information you provide, the better the solution you will receive.

    3) One question per thread. Do not post multiple questions in one thread; that way, we can resolve questions individually. Make a new thread for each question you have, unless your questions are closely related.

    4) Be polite. The more polite you are, the more people will want to help you. Be patient, and we will help you find the solution to your problem.

If your question has been resolved, please say so. A thank you would also be nice. If your question has NOT been answered, say so in the original topic. If your topic has been moved to resolved, you may then AND ONLY THEN post a new topic regarding the same issue.

Is AJAX running for main pages? (Want an easy gallery)

Postby peachpunk » March 20th, 2017, 8:02 am

I'm trying to put together a gallery page on my comic's additional pages section of all the art folks have done for us, and I don't want to hand-jam additions, in case I'm traveling or busy and can't get them up quickly.
Thinking I want to just put together an ajax script to toss up the contents of a folder on my own private server on the page. Or maybe I should make each one a news post so people can reply? I never did end up using my news section. What have you guys done in terms of galleries and does anyone know if ajax is running? Googled but couldn't find any definitive answer.
User avatar
peachpunk
 
Posts: 3
Joined: October 6th, 2014, 8:14 pm

Re: Is AJAX running for main pages? (Want an easy gallery)

Postby eishiya » March 20th, 2017, 8:50 am

AJAX is not something that "runs" server-side. AJAX is just JavaScript (which is client-side) that trades data with the server without having to (re)load pages.

Since the script would be loaded on a page hosted by SmackJeeves and the data is on your own server, the same-origin policy could prevent your script from working, depending on how it's set up. For something like a gallery, there should be ways to do everything though. Fetching a list of images from another server and generating HTML to display them shouldn't be a problem at all, in any case. You could even do that without AJAX, but with just plain JS that runs on page-load and then never contacts the server after that. AJAX is needed for interactive applications. You'd need AJAX if you wanted to roll your own comment system, but that's probably overkill.
Image
User avatar
eishiya
 
Posts: 9169
Joined: December 5th, 2009, 11:17 am

Re: Is AJAX running for main pages? (Want an easy gallery)

Postby peachpunk » March 20th, 2017, 9:08 am

Thanks for the detailed answer, Eishiya! And for the guidance too, my scripting usually end up as just a bunch of bumbling until I find the right answer.I'll look into some JS options and do some planning. Thanks again! :)
User avatar
peachpunk
 
Posts: 3
Joined: October 6th, 2014, 8:14 pm

Re: Is AJAX running for main pages? (Want an easy gallery)

Postby Admin » March 20th, 2017, 8:50 pm

Regarding cross-domain AJAX, there is also a technique called JSONP which works around the same-origin policy eishiya mentioned. I'd like to add a gallery system to SJ in the future, but there are a few things to do before that.
User avatar
Admin
Site Admin
 
Posts: 1259
Joined: August 17th, 2005, 11:10 pm


Return to New Questions

Who is online

Users browsing this forum: No registered users and 4 guests