Welcome Guest, Not a member yet? Register   Sign In
MeNeedz Shoutbox
#11

[eluser]John_Betong[/eluser]
[quote author="waldmeister" date="1234018858"]Ok, thx for the feedback!
I kinda forgot about the restrictions in most browsers, that you can't use AJAX to request data from another domain...and as far as I can tell,most browsers won't allow www.davidbehler.de to get data from davidbehler.de.
...
...
@John_Betong: What exactly is not working? New shouts not added to the list? List not updated?[/quote]
 

http://johns-jokes.com/shoutbox/
 
Using Firefox's Firebug the following error is displayed:

Ajax is not defined
[Break on this error] new (Ajax.Updater)("shout_list",...: $("add_shout_form").serialize(true)});

 
 
#12

[eluser]davidbehler[/eluser]
Are you sure the prototype.js file you included exists?
Because if I try to access http://johns-jokes.com/javascript/prototype.js, I get 404 Page Not Found.
#13

[eluser]John_Betong[/eluser]
[quote author="waldmeister" date="1234032130"]Are you sure the prototype.js file you included exists?
Because if I try to access http://johns-jokes.com/javascript/prototype.js, I get 404 Page Not Found.[/quote]
 
I have made the path modifications and now moved onto the next error.

It has been a long day for me and I am off for a beer Smile
 
#14

[eluser]davidbehler[/eluser]
More errors?
Care to share?
Maybe I can help Smile
#15

[eluser]John_Betong[/eluser]
[quote author="waldmeister" date="1234035343"]More errors?
Care to share?
Maybe I can help Smile[/quote]

from my website: http://johns-jokes.com/shoutbox/

XMLHttpRequestDebug: file path: /home/jjokes/public_html/ci_jokes/models/shoutbox_model.php

I reckon I had better start again since I have made so many changes trying to get the original script to work.

Thanks for your help.

I am definitely going for a beer now - catch you tomorrow.
 
#16

[eluser]John_Betong[/eluser]
 
Many thanks to waldmeister for his original Shoutbox creation.

I created a library and managed to get the ShoutBox working: http://johns-jokes.com/

Library source and install files: http://johns-jokes.com/downloads/codeign...nstall.zip


Installation instructions:

1. Creat your MySql table:

CREATE TABLE IF NOT EXISTS `shout` (
`shout_id` bigint(20) NOT NULL auto_increment,
`shout_author_user_name` varchar(20) collate utf8_unicode_ci NOT NULL,
`shout_message` varchar(140) collate utf8_unicode_ci NOT NULL,
`shout_date_create` datetime NOT NULL,
PRIMARY KEY (`shout_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

2. copy these files into the relevant directories - beware of the javascript file location.

./javascript/prototype.js

./libraries/MY_Input.php
./libraries/MY_shoutbox.php

./models/shoutbox_model.php

./views/_shout_box.php
./views/_shout_list.php

3. include these two lines in your VIEW_FILE.php header:

<?php $js_shoutbox = base_url()."javascript/prototype.js"; ?>
[removed]

4. include these four lines before calling $this->load->view('VIEW_FILE', $data)

$this->load->library('MY_shoutbox', $data);
$this->load->model('shoutbox_model', '', TRUE);
$data['shout_list'] = $this->shoutbox_model->get_shoutbox_list();
$data['shoutbox'] = $this->load->view('_shout_box', $data, TRUE);


5. include these three lines somewhere suitable in the body of your VIEW_FILE.php

<fieldset>
&lt;?= $shoutbox ?&gt;
</fieldset>

6. And to quote our Guru "And away we go'
&nbsp;
#17

[eluser]The Wizard[/eluser]
works in opera.
#18

[eluser]Unknown[/eluser]
Hi,

Tnanks for your work...

I tried your code, but I have a javascript error when I try to submit.

It's : Ajax undefined.

I don't understand why...

Could-you help me please ?!

Thanks.
#19

[eluser]davidbehler[/eluser]
Have you included the prototype.js file?
#20

[eluser]tonydewan[/eluser]
I'm not totally sure what your use case for this is...is this meant to be behind some kind of preexisting authentication? For example, like Facebook's wall? Or is it meant for direct public access?




Theme © iAndrew 2016 - Forum software by © MyBB