PDA

View Full Version : Help with Ajax RSS script mod



aztech4mac
03-01-2010, 10:49 PM
1) Script Title: gAjax RSS Pausing Scroller (hosted)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex18/gajaxpausescroller.htm

3) Describe problem: First, thank you very much for this script set, works like a beauty... I've already modified it a bit to change the scroll delay by the user.

I need a further mod which I can't seem to figure out. I have a form popup menu that has several different rss feeds. I want to be able to kill the current rss feed and reset to a different one from the popup menu. All my attempts just turn the entire page blank. I'm guessing one or both the js scripts will need an additional function or two but I'm just not savvy enough to figure this out.

TIA

student101
03-02-2010, 08:09 PM
You want to change rss feeds in the parent from a popup?

aztech4mac
03-02-2010, 08:23 PM
Yes, the init code is set to add one or more url's. Adding more than one just mixes the rss feeds. I only want one feed at a time. My popup has multiple url's for different rss feeds. I want the user to be able to select a feed from the popup. Basically I'll need to flush the current feed and substitute another feed. I've browsed the js files to see if there was a global way to do this and I didn't see any, but I'm just not that savvy on js to be sure I haven't overlooked the obvious. Any ideas...

student101
03-02-2010, 08:36 PM
What a database that holds the rss feeds,

Open a popup - change the feed, refresh the parent and close the popup.I am sure there are ajax methods for this.

aztech4mac
03-02-2010, 09:06 PM
I'm using googles ajax rss thingie... I have a list if url's in the popup menu's value property. I initialize the the feed with one of the url in the popup. The popup is not the problem. I can't seem to find a way to manipulate the js to swap the feed url. Have you looked at the code for this? The link is on my first post. The code as is, is meant to only use what was initially entered in the initial setup code, I need to swap the initial url with a new one from the popup then call the fetch routine again.

aztech4mac
03-03-2010, 05:23 PM
Ok, maybe I'm asking the wrong question...

How about, is there a way to remove the current feed? there is already code to add a new feed. Seems I can get what I need if I can remove a feed then add a new. I'm guessing that 95% of what I need is already there.

student101
03-03-2010, 06:26 PM
Do you have an example of what you want?

aztech4mac
03-03-2010, 08:51 PM
101... I'm not understanding your last post.

I think I'm being clear. I need a mod to the javascript code for the AJAX RSS scroller. I can work out how to use it from the poupmenu. You're focused on the popup and I need the js modded.

So, one more time. I need to have the ability to clear a current rss feed being displayed in the scroller and add a different one. That's all, nothing more, there is no example to see, nothing to show, just an additional or modified function to the js code used in the scroller.

But thanks for helping bump this to the top...

student101
03-03-2010, 10:51 PM
I'm not understanding your last post.
But thanks for helping bump this to the top...
The intention was to see (http://www.w3schools.com/JS/js_ex_dom.asp) if you actually had any code (http://www.dustindiaz.com/add-and-remove-html-elements-dynamically-with-javascript/)

aztech4mac
03-04-2010, 03:56 AM
101 I know you are trying to be helpful, but have you even looked at the example? There is no HTML, There is two external js files and an inline js init code block.

I have not modified the code at all. I have added one line to my web js to change the scroll delay...

newsfeed.delay=3000

To be clear, the example works just as it was intended to and I have it working with a single rss feed. The purpose of my original post was to get some assistance in modifying the original js to extend the functionality of the example.

Frankly, I don't see why the guys at DD wouldn't jump on this at it seems to me it would be a nice and welcome addition the the original code.

student101
03-04-2010, 06:48 AM
I have a form popup menu that has several different rss feeds. I want to be able to kill the current rss feed and reset to a different one from the popup menu.

please post your code,

your code will help me and others following this thread undersand (http://www.w3schools.com/JS/tryit.asp?filename=try_dom_option_settext)

Why not use this one (http://www.dynamicdrive.com/dynamicindex18/rssdisplaybox/index.htm)?

aztech4mac
03-04-2010, 07:46 AM
I have no code to show. Please see;

1) Script Title: gAjax RSS Pausing Scroller (hosted)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...sescroller.htm

This is the only code. Can you show me a way to remove a current rss feed and replace it with a new one?

You seem to stalled on how I will use such a method and I'm asking for a method. Show me a way in the js code to do what I need and I'll show you how I intend to use the method. This was and still is my original request.

It'd be nice to have someone from DD chiming in on this...

student101
03-04-2010, 08:05 AM
First off; you said that you had a popup menu with RSS feeds.
Where is it?

Secondly I've given you major examples on how to change HTML elements which is pretty helpful, a bit of reading and testing - who knows you might create this new thing you want DD to add.
I'm off (http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_html_change_p), Good luck (http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax2)!

aztech4mac
03-04-2010, 04:48 PM
I can't help getting the feeling I'm being punked!

First off, No! I stated I need help modding the js script for the gAjax RSS Pausing Scroller (hosted)... see my first post!

Second, No again!, You've sent me off on wild goose chases that have nothing to do with what I need and am asking for.

I'm not sure why your posting if you can't help answer my original call for help.

So to satisfy your undying need to see how I'm doing this from a popup here is a slice for my form popupmenu html. In contains a link to an rss feed from moreover.

<option value="http://p.moreover.com/page?dh\x3dearliest\x26wiz\x3d2390512\x26o\x3drss002\x26c\x3d3G%20and%20GPRS%20news\x26relf\x3d2\x26r\x3d1|2|3\x26_\x3d1267412096371">3G &amp; GPRS News</option>

Now if I had a way using the js to kill, delete, remove, clear, zap, destroy, undo, quit, flush, eliminate, or any other description the current feed and replace it with a new feed url then we're in business.

student101
03-04-2010, 05:34 PM
Like I said you need to learn to read,
I've posted the answer previously, you need to do some work and stop expecting people to just give you the code that was already previously posted.
If you can't read this; then I'm really out!


<html>
<head>
<script type="text/javascript">
function changeText()
{
var x=document.getElementById("mySelect");


// replace it with a new feed url...
x.options[x.selectedIndex].text="RSS feed 5";


}
</script>

</head>
<body>

<form>
Select your favorite fruit:
<select id="mySelect">
<option>RSS feed 1</option>
<option>RSS feed 2</option>
<option>RSS feed 3</option>
<option>RSS feed 4</option>
</select>
<br /><br />
<input type="button" onclick="changeText()" value="Set text of selected option">
</form>

</body>
</html>

By the way;
What you posted isn't a RSS feed!

You already have this functionality (http://w.moreover.com/public/free-rss/rss-feeds.html) why you keep asking?

aztech4mac
03-04-2010, 07:54 PM
Your fixated on the friggin' popup! STOP!

What you posted is what I already have!

What I need help with is the GOD DAMN js code that doesn't allow the substitution of an rss feed. How many times do I need to say that!

I you bothered to look at the example I'm looking for help with you'd see that it uses Google RSS API and that URL i gave IS AN RSS FEED FROM MOREOVER!

Your not helping and you're only mudding the water.. I'm sure everyone viewing this thread is enjoying this though...

student101
03-04-2010, 08:25 PM
Your fixated on the friggin' popup! STOP!
only mentioned a popup as a non ajax way.

I you bothered to look at the example I'm looking for help with you'd see that it uses Google RSS API and that URL i gave IS AN RSS FEED FROM MOREOVER!
You haven't posted any google API feed except for DD code.

Your not helping and you're only mudding the water.. I'm sure everyone viewing this thread is enjoying this though...
I have given the answer to what you asked;

replace a new feed url
You're confused and moreover isn't your site.
If anyone viewing this thread saw what I posted wasn't of worth!!! they wouldv'e fixed that straight away - like I say
The question has been answered to the best of my ability based on the "weak" question posted.

Let me ask;
what exactly do you want to CHANGE, post the EXACT code you want changed!


I would like to change the text in brackets from
Bob to John
(Bob) will ask the question.
With the code I posted will now become
(John) will ask the question.

aztech4mac
03-04-2010, 09:04 PM
You accuse me of not reading what your saying, but in fact you are not reading what I'm saying. You never have since my first post. You obviously have not looked at the example that I asking for help with. If you did you would not be making the statements and assumptions you are stating in this thread.

If you can't look at the example and read what is on that page, please don't post any more. There are two js external files that I need modded... that's it. Look or don't post!

My god man don't be so anxious to reply and investigate the example or stay out of it.

student101
03-04-2010, 09:10 PM
You haven't specifically stated what you want changed, you ask for something but for what?

You want the js files changed...
Which one? gfeedfetcher.js OR gajaxscroller.js
Where in the js file (what line or what code) do you want your proposed change?

Be more specific and you may get your answer.

aztech4mac
03-04-2010, 09:26 PM
I can't tell you which one but I'm assuming gfeedfetcher.js, but possibly both need changing. I've stated at least a dozen times that the code as is does not allow a current rss feed to be flushed and replaced with a new rss feed. There is a function to ADD an rss feed which combines the current feed with the new one, but this is not what I want. The old feed needs to be removed first then a new one added.

I can't say it more clearly than I need a way to remove an existing rss feed and replace with a new rss feed. I'd be able to do this if I was more adept in js, but I'm not. I can't point you to any specific function in either of the files and I suspect a new function must be added to accomplish what I'm looking for.

I appreciate you looking at the example page and I hope you see how this is working. That url is a moreover news feed this is intended to work with the Google rss api as the example instructions explain. If you're going to help focus on the two js files only. That's where I need the help.

student101
03-04-2010, 09:43 PM
What you want is a ddadmin or jscheuer1 mod, they are the creators.
if in serious, serious need - try PM them.

If they can answer your question - they will!

regards!

aztech4mac
03-04-2010, 10:01 PM
Thank you... I think they are staying out of this hoping I'll pay for the mod. I don't know anyone qualified to sift through the current code and make the changes.

I might just have to pony up the $$$. I'll try a PM and see what happens. I really don't think this is a major project, but what do I know.

As I said before the scripts are working perfectly, I just need them to work a bit differently. I appreciate your attempts in assisting and also the authors of the script for the free donation to the community.